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
- In ARCNM, open Settings, then API keys, then New key. ARCNM shows the key once.
- 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 |
|---|---|---|
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. | 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 may read files from. |
read_only |
False |
Toolkit only. Leaves out the tools that 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 reads the file path the model gives it and sends 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.
Links
License
MIT
Metadata
Release files for langchain-arcnm 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langchain_arcnm-0.1.0.tar.gz | 22.8 kB | With provenance | Details for langchain_arcnm-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langchain_arcnm-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for langchain_arcnm-0.1.0-py3-none-any.whl |
Total release size: 36.0 kB
Release files / langchain_arcnm-0.1.0.tar.gz
| Download URL | langchain_arcnm-0.1.0.tar.gz |
|---|---|
| Size | 22.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9895c123dfe2d90913bd819fb653b3a9a2b8458c17e09f0f31e13163fd21006c
|
|
BLAKE2b-256 checksum How to use checksums |
bb9edebdd356f17b1bc6ea4b05102aeeb58f9b8c54de5655e6d7ed90a05e105d
|
| 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 5, 2026.
Transparency logRelease files / langchain_arcnm-0.1.0-py3-none-any.whl
| Download URL | langchain_arcnm-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4d7ca3539dfc5ec1793b3e6966278a0f4b53fb07a825113a13cae890e9cb2e16
|
|
BLAKE2b-256 checksum How to use checksums |
8cfa6cc080a26217a26452aee9e2ff5c9eef2826e384161ac6e26fda27750832
|
| 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 5, 2026.
Transparency logSecurity for langchain-arcnm 0.1.0
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.
Attestation for langchain_arcnm-0.1.0.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 5, 2026.
Transparency logA 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.