Skip to main content

langchain-arcnm

Manufacturing should-cost from a CAD file, for your LangChain agent.

ARCNM turns a STEP file into an itemised manufacturing cost for machined and sheet-metal parts: unit cost, setup cost, cycle time, and the cost sheet behind them. This package gives a LangChain or LangGraph agent the ARCNM REST API as tools, so it can price a part, explain what drives the cost, and compare lot sizes.

pip install -U langchain-arcnm

Setup

  1. In ARCNM, open Settings, then API keys, then New key. ARCNM shows the key once.
  2. Export it:
export ARCNM_API_KEY="..."

Reads need the parts:read scope. Starting or cancelling a calculation needs parts:write. The Free plan includes 10 calculations a month, no card required.

Use it in an agent

from langchain.agents import create_agent
from langchain_arcnm import ArcnmToolkit

agent = create_agent(
    "anthropic:claude-sonnet-5-5",
    tools=ArcnmToolkit(root_dir="./cad").get_tools(),
)
result = agent.invoke(
    {
        "messages": [
            {
                "role": "user",
                "content": "What does bracket.step cost at a lot of 50, and what drives it?",
            }
        ]
    }
)
print(result["messages"][-1].content)

Call a tool directly

from langchain_arcnm import UploadAndQuoteTool

quote = UploadAndQuoteTool()
print(quote.invoke({"file_path": "bracket.step", "lot_size": 50}))

Every tool returns JSON as a string. An API error comes back as the tool result, with its stable error code and request id, so the agent can react to it; set handle_tool_error=False to have it raised instead.

Tools

Tool What it does Uses a calculation
precheck_part Before pricing a STEP file: one part or an assembly, its bill of materials, and how many calculations pricing it uses. Starts nothing. No
upload_and_quote Uploads a CAD file, and a drawing if you have one, and prices it. Yes
quote_part Prices a part revision ARCNM already has, at another lot size or in another costing environment. Yes
cancel_calculation Stops a calculation that is still queued or running. No
get_calculation Reads one calculation: status, costs, cycle time, confidence. wait=true waits for it to finish. No
list_calculations Lists recent calculations, by status or part. No
get_cost_sheet The itemised cost sheet, at the priced lot size or any other: each line's amount per unit, time and rate. No
list_parts Finds parts by part number. No
list_part_revisions Lists a part's revisions, for quote_part. No
list_environments Lists the costing environments (machines, rates, materials) a calculation can price with. No
check_quota How many calculations are left in this period. No

The names match the ARCNM MCP server, so an agent sees the same verbs on either surface.

upload_and_quote, quote_part and get_calculation with wait=true wait up to wait_timeout seconds (default 120) for the result. A calculation still running after that comes back with its id, and the agent can ask again with get_calculation.

Configuration

Pass these to ArcnmToolkit or to any single tool.

Argument Default
api_key ARCNM_API_KEY Your ARCNM API key.
base_url ARCNM_BASE_URL, else https://api.arcnm.io Change it only when you were given a different origin.
org_slug ARCNM_ORG_SLUG The organization to act in, for a key that belongs to several.
root_dir none The directory upload_and_quote and precheck_part may read files from.
read_only False Toolkit only. Leaves out the tools that store a file or start or stop a calculation.
wait_timeout 120 Seconds to wait for a started calculation. 0 returns at once.
poll_interval 2 Seconds between status checks while waiting.
request_timeout 60 Seconds one HTTP request may take.

Security

upload_and_quote and precheck_part read the file path the model gives them and send that file to ARCNM. Set root_dir so it can only read the folder you meant, and use read_only=True for an agent that should never start a calculation. A key with only parts:read cannot start one either.

Development

uv sync --all-groups
make test              # unit tests, no network
make integration_test  # against the live API; needs ARCNM_API_KEY, uses no calculations
make lint

make integration_test BILLABLE=1 also quotes tests/integration_tests/shaft_thread.step, which uses one calculation.

arcnm-contract.json lists every ARCNM operation and field this package relies on. ARCNM checks it against every change to its API before that change merges. It is not part of the published package.

License

MIT

Metadata

Release files for langchain-arcnm 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-arcnm 0.1.1
File Size Uploaded Provenance Actions
langchain_arcnm-0.1.1.tar.gz 25.9 kB With provenance Details for langchain_arcnm-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-arcnm 0.1.1
File Interpreter ABI Platform Actions
langchain_arcnm-0.1.1-py3-none-any.whl Python 3 none any Details for langchain_arcnm-0.1.1-py3-none-any.whl

Total release size: 41.0 kB

Release files / langchain_arcnm-0.1.1.tar.gz

Download URL langchain_arcnm-0.1.1.tar.gz
Size 25.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e024698cbb0eef516caccf163be42ef2d0c03dab31122c222cb3cc51b92959c2
BLAKE2b-256 checksum
How to use checksums
f45d39123709decc919ad16478fe32de01923469c13ab547d5f5ce390a125af7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / langchain_arcnm-0.1.1-py3-none-any.whl

Download URL langchain_arcnm-0.1.1-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a28b96bce54306112ae769d1b6970ac8f22762226eb5e67b848f827e8cc5b5d0
BLAKE2b-256 checksum
How to use checksums
0c482ce2136c236dd3f47e4e1ec3a733f8c8e9ed72b6669f27eed38050c200e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for langchain-arcnm 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for langchain_arcnm-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page