---
title: MCP — agents and IDEs
description: Connect Claude, Claude Code, Cursor or any MCP client to ARCNM over HTTP with OAuth or a bearer token: quote parts, inspect calculations and read your data.
---

# MCP for agents and IDEs

ARCNM ships a [Model Context Protocol](https://modelcontextprotocol.io)
server. MCP-speaking agents and IDEs can quote parts, explain and compare
costs, and read your data through typed tools — without you writing glue
code. Its registry entry is `io.arcnm/arcnm`, and
[arcnm/arcnm-mcp](https://github.com/arcnm/arcnm-mcp) has a one-page setup
guide for each client.

Endpoint: `https://api.arcnm.io/mcp-server/mcp` (HTTP transport,
bearer-JWT protected).

No account? A second, keyless MCP server at
`https://api.arcnm.io/mcp-server/pay/mcp` sells calculations per call,
paid in USDC (a card pays the same offer over HTTP): see
[Pay per call](./pay-per-call.md).

---

## Why MCP, not REST

If you're writing application code, use [REST](./api/index.md). Pick MCP
when **an agent is the client** (Claude, Cursor, custom runtimes): it
discovers tools automatically and routes arguments through structured
schemas.

---

## Authentication

The MCP server is a bearer-token protected resource. It publishes
[RFC 9728 protected-resource metadata](https://datatracker.ietf.org/doc/html/rfc9728)
at `/.well-known/oauth-protected-resource/mcp-server/mcp` — RFC 9728
appends the resource path to the well-known prefix, so the bare
`/.well-known/oauth-protected-resource` is a 404 by design. The verifier
accepts **either**
credential in the `Authorization: Bearer …` header:

- an ARCNM **API key** (`ak_live_…` / `ak_test_…`) — recommended for
  agents: long-lived, revocable, scoped (tried first); or
- a tenant-scoped **session access token** (JWT, audience-pinned to
  `/api/v1`; refresh tokens and other-audience tokens are rejected).

Mint an API key in the dashboard (Settings → API keys) and pass it as the
bearer token — that's all most agents need.

Interactive clients (Claude, …) can instead **sign in with OAuth** when the
deployment enables it: ARCNM runs a full OAuth 2.1 authorization-code flow
with dynamic client registration and a consent screen where the user picks the
org and the scopes to grant (read-only by default). The client receives a
short-lived, org-scoped, scope-limited token — no key to copy. Either way the
credential resolves to the same tenancy + scope checks.

The server tells an OAuth client which scopes its tools use. The authorization
server advertises exactly `parts:read`, `parts:write`, `uploads:read` and
`uploads:write`, and a `401` from the MCP endpoint names them in its
`WWW-Authenticate` header (`scope="parts:read parts:write uploads:read
uploads:write"`, [RFC 6750 §3](https://datatracker.ietf.org/doc/html/rfc6750#section-3)).
A client that requests them shows them on the consent screen, and you decide
what to grant. A client that requests no scope gets the read-only ones.

A `401` to a request that sends no credential at all also names the keyless
server: its body's `error.details.no_account` holds the pay server's endpoint
(`mcp`) and the [Pay per call](./pay-per-call.md) guide.

---

## Connect

### Claude (claude.ai and Claude Desktop)

ARCNM is listed in the
[Claude connector directory](https://claude.ai/directory/arcnm). Add it
from there and sign in to ARCNM: the consent screen asks which org and
which scopes to grant (see [Authentication](#authentication)). No API key
to copy.

### Claude Code (CLI)

Sign in with OAuth: add the server by its URL, then authenticate from inside
Claude Code. A browser opens for the consent screen; no key to copy.

```bash
claude mcp add --transport http arcnm https://api.arcnm.io/mcp-server/mcp
# then, in Claude Code:
/mcp        # select "arcnm" → Authenticate
```

Or use an API key as the bearer token:

```bash
claude mcp add --transport http arcnm https://api.arcnm.io/mcp-server/mcp \
  --header "Authorization: Bearer $ARCNM_MCP_TOKEN"
```

To list every toolset rather than the 18 default tools (see
[Toolsets](#toolsets)), add the `X-MCP-Toolsets` header:

```bash
claude mcp add --transport http arcnm https://api.arcnm.io/mcp-server/mcp \
  --header "Authorization: Bearer $ARCNM_MCP_TOKEN" \
  --header "X-MCP-Toolsets: all"
```

### Cursor

Add the server to `~/.cursor/mcp.json` (every project) or `.cursor/mcp.json`
(one project). With only the `url`, Cursor signs in with OAuth. To use an API
key instead, add the header; Cursor reads `${env:NAME}` from the environment:

```json
{
  "mcpServers": {
    "arcnm": {
      "url": "https://api.arcnm.io/mcp-server/mcp",
      "headers": { "Authorization": "Bearer ${env:ARCNM_MCP_TOKEN}" }
    }
  }
}
```

The tools appear under MCP in Cursor's settings.

### VS Code

Add the server to `.vscode/mcp.json`. With only the `url`, VS Code signs in
with OAuth. To use an API key instead, let VS Code ask for it once and keep
it out of the file:

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "arcnm-key",
      "description": "ARCNM API key",
      "password": true
    }
  ],
  "servers": {
    "arcnm": {
      "type": "http",
      "url": "https://api.arcnm.io/mcp-server/mcp",
      "headers": { "Authorization": "Bearer ${input:arcnm-key}" }
    }
  }
}
```

### ChatGPT

ARCNM is listed as a
[ChatGPT app](https://chatgpt.com/plugins/plugin_asdk_app_6accf70b9d4481919f149996adaba0be). Add it
from there and sign in to ARCNM with OAuth; no API key to copy. You can
also add ARCNM as a custom connector in ChatGPT's developer mode, with the
URL `https://api.arcnm.io/mcp-server/mcp`.

### Other clients

Any MCP-compliant HTTP client works. Point the transport at
`https://api.arcnm.io/mcp-server/mcp`, send the bearer header, and call
the standard `tools/list` method to discover the surface.

A client or directory can read what the server is before it connects: the
server card (draft SEP-2127) answers without a token at
`https://api.arcnm.io/mcp-server/mcp/server-card`, with the description in
English and German, the 18 default tools and the prompts.

---

## What's exposed

The surface is the **public developer API** and nothing else, exposed as
**Tools** — the [default list](#default-tools) plus the optional
[toolsets](#toolsets) (a strict, deny-by-default
allow-list; an MCP tool is model-invoked, so the surface is the security
boundary):

- **Reads** (parts, calculations, uploads, environments, materials, tools,
  subcontractors, calibration) are **read-only Tools** (`readOnlyHint=true`).
  Material search (`materials_suggest`, `materials_lookup`) counts as a read
  even though it is a POST: the query rides in the body, nothing is written.
- **Your own identity** (`GET /users/me`, `/users/me/context`) is a read-only
  tool for a **signed-in app session only**. Those two routes refuse every API
  key and every OAuth grant over REST, so a key or a grant never sees them in
  `tools/list` either. A key or a grant acts for the one organization it was
  issued in.
- **Writes** (create a part, create/run/quote a calculation, upload inputs) are
  Tools carrying an idempotent / destructive hint.

There are **no Resources or Resource Templates** — an agent-first data API is
model-invoked, which is Tool semantics, so reads and writes live in one
`tools/list` (matching GitHub's and Stripe's MCP servers) rather than being
split across `tools/list` and `resources/list`. Use `readOnlyHint` to tell a
data-fetch from a mutation.

The [default tools](#default-tools) have short `verb_noun` names
(`quote_part`, `get_calculation`). The tools in the optional
[toolsets](#toolsets) keep the names generated from the REST operation ids
(roughly `<tag>_<operation>`, e.g. `calculations_create_calculation`).
**The authoritative list is whatever `tools/list` returns for your token and
toolsets** — generate it from the live server rather than hardcoding names.

> **What's never exposed.** Everything outside the public developer API:
> wallet and billing operations, plan changes, member invites/roster,
> API-key minting, the credential vault, SSO/SCIM, raw payment-provider
> webhooks, feature flags, auth/session primitives, the **audit log** and
> other admin-only endpoints, the AI surfaces, the platform's background-job
> queue, and all user identity mutations (including cross-user reads). An agent with a
> tenant token cannot move money, escalate access, mint credentials, read
> the admin plane, or rewrite the tenant — those stay human-dashboard-only
> by design.
>
> Three pricing-configuration surfaces are app-only on top of that, and it is
> worth being precise about which: the environment
> **`/environments/{id}/effective-rates`** read and edit, the platform's
> **cutting data** (`/environments/{id}/cutting-data` read + edit,
> `/tools/{id}/effective-cutting-data` read), and the environment
> **`/environments/{id}/assumptions`** read, which resolves the whole
> parameter plane those reads draw from. All resolve the platform's
> own curated defaults, which are ours and not part of what you integrate
> against. Your **rate rows** are yours and stay callable — an agent can read,
> write and delete them (`/environments/{id}/rates`), set or clear a
> material price, and read, set or clear a scrap price
> (`/environments/{id}/rates/scrap`) — and so are **your tools' own
> cutting-data rows**: read them on `GET /tools/{id}`, write them with
> `tools_upsert_tool_parameters` and delete one with
> `tools_delete_tool_parameter` (both in the `catalog` toolset).
>
> The **writes of the available environments** are app-only too, but for
> installing one (`POST /environments/from-catalogue`), which an agent does
> with `create_environment` (`start_from: "preset"`; a country your
> organization does not price in yet is an owner's or admin's to take):
> changing, applying, reverting or detaching a follow
> (`PUT /environments/{id}/subscription`, `POST …/subscription/apply`,
> `POST …/subscription/revert`, `POST …/subscription/detach`), turning a
> follow's new-version notifications on or off
> (`PATCH /environments/{id}/subscription` — it decides what your people are
> told about, like an alert rule), cutting a version
> (`POST /environments/{id}/versions`) and moving a channel
> (`PUT /environments/{id}/channels/{channel}`). The available environments
> themselves, cost regions, cost drivers, a follow's state and diff, versions and channels are
> read-only tools, as is the diff between two of your own versions
> (`GET /environments/{id}/versions/{a}/diff/{b}`) and the market events the
> platform detected (`GET /market/events` — moves, publisher revisions,
> source outages and new versions of available environments, the same list for every
> organization; a value whose licence keeps it off public surfaces is
> listed without the value).
>
> The **re-price** (`POST /calculations/{id}/reprice`, `POST /calculations/reprice`)
> is app-only: each call creates new calculations, each billed when it
> succeeds. Its free half stays callable — `POST /calculations/{id}/reprice-preview`
> estimates what a re-price would move from the calculation's stored cost
> shares without pricing anything, `GET /calculations/{a}/diff/{b}`
> shows what moved between two runs of one part, and
> `GET /calculations/{id}/regional-screen` estimates the same part's unit
> cost in every priced cost region from those cost shares — a free read,
> ranked, never a re-price.
>
> **Logistics profile writes** are app-only too: creating, editing or
> deleting a profile (`POST /logistics-profiles`,
> `PATCH`/`DELETE /logistics-profiles/{id}`) and setting an environment's
> default (`PUT /environments/{id}/logistics-profile`) or a folder's
> (`PUT /folders/{id}/logistics-profile`) decide what every quote of an
> environment or a folder's parts is explained with. The profiles themselves and the
> landed-cost what-if (`GET /calculations/{id}/landed-cost` — free, never
> saved, never a re-price) are read-only tools.
>
> The **master-data import commits** (`POST /import/machines`,
> `POST /import/tools`) are no tools of their own: one call adds a whole
> fleet or crib. An agent reaches them through `import_setup_data`, which
> previews first and commits only the plan it showed. The dry-run halves
> stay callable — `POST /import/machines/preview` and
> `POST /import/tools/preview` read your file and report per-row what a
> commit would do, without writing anything.
>
> The **calibration-import price commit**
> (`POST /calibration/imports/{id}/price`) is no tool of its own either:
> one call starts the calculations a whole history needs. An agent
> reaches it through `import_history`, which shows the cost disclosure
> first and sends the count it confirmed as `expected_calculations`. No
> call starts more calculations than that. See
> [Calibrating from your history](#calibrating-from-your-history).
>
> **Job nests** (`/nest-runs`) and **remnant stock** (`/remnants` — list,
> state, scrap) are on the REST API, and their generated tools are not on the
> agent surface. An agent nests a backlog through the curated
> job-nest tools instead: the start plans first and takes
> an explicit `apply=true`, because a job nest takes the remnants it cuts
> from out of your stock, and so does the release that books a job nest
> for the cutting line. Stating and scrapping remnants stays with the
> people and the stock system that keep your racks; an agent reads the
> remnants a job nest could cut from, used and created through those tools.
> They are in the `nesting` toolset.
> The cutting files — a job nest's sheets, or a calculation's own sheet, as
> DXF, SVG or the JSON nest plan — come through `export_nest_layout`: the
> plan inline, DXF and SVG as download
> links, since a tool result is no place for a drawing.
>
> **Nesting potential** (`GET /nesting/potential`) and the run meter
> (`GET /nesting/runs`) are on the REST API. Their generated tools are not
> on the agent surface: the rest of that family can return a layout or a
> selection's price. `get_nesting_summary` returns what nesting the
> organization's sheet quotes of the last 90 days together on shared sheets
> would save, and how many runs are used and left. The figure is a lower
> bound against each part on its own sheet — floored without the Nesting
> add-on — and never one quote's price or a layout. It is not a price
> difference: every sheet quote is nested true-shape on every plan.

Scopes mirror the [REST scope catalog](./authentication.md#scopes): a
token needs `parts:read` to read, `setup:write` to change an environment
and what it prices with, `calibration:write` to calibrate one (`parts:write`
covers both), and `parts:write` to create or run a
calculation. Request the minimum the agent needs.

**`tools/list` is filtered to your token's scopes.** The server returns only
the tools your credential can actually call — a `parts:read` key sees the
read-only tools, not the write tools it could only `403` on. (A token from
your own signed-in session carries no scopes, so its list follows your role in the
organization instead, matching the REST gate: a viewer sees the read tools
only. Such a session also sees the identity reads, which only it can call.)
So the surface an agent discovers is already least-privilege; widen it by
minting a broader-scoped key, not by working around a missing tool.

The list is intentionally **not paginated** — the whole (already scope-scoped)
surface is returned in one `tools/list` response. The MCP cursor is optional
and we don't emit one; paging wouldn't help anyway, since a client that holds
the surface ends up holding all of it either way.

What it costs you is worth knowing, because most hosts put every tool
definition into the model's context. Two things keep it down, and one of them
is yours: the generated tools describe their arguments but not their response
shape — read response schemas from
[the API reference](https://arcnm.io/docs/api), which publishes them once
instead of repeating them per tool — and **a narrower credential is a smaller
surface**, since the list is scope-filtered. A `parts:read` key sees about half
the tools of a full-scope one. Scope the credential to what the agent actually
does, and opt into a toolset only when the agent needs it. The curated cost
and nesting tools declare typed output and are built to be token-light.

---

## Default tools

With no `X-MCP-Toolsets` header, `tools/list` returns these 18 tools (12
reads, 6 writes), further narrowed to what your credential's scopes allow.
They take a part from its CAD file to an explained, improved and compared
price:

| Tool | What it does | Read or write |
|---|---|---|
| `precheck_part` | Reads a CAD file the way its calculation will, before it starts: how an assembly splits into made parts, catalogue parts and parts left out, how many calculations it starts, how many your plan pays for and the overage it may cost. Free, never billable; start it with `upload_and_quote` and `precheck_id`. | write |
| `get_precheck` | One precheck: its status to poll and, once read, its answer. | read |
| `attach_drawing` | Gives a drawing to the part it belongs to, whatever the two files are called. Before a run, on a precheck: `precheck_id` and a row's `component_key` (or `assembly`), with a drawing the precheck holds (`data_source_id`) or a new file as base64; free, nothing is billed before the start. After a run, on the part's own calculation (`calculation_id`): with `run` (the default) the part is priced again, billable only if it succeeds. By default it plans and attaches nothing; `apply=true` attaches. | write |
| `upload_and_quote` | Prices a new part from its CAD file in one call: a STEP file as base64, or a DXF flat pattern with its sheet thickness and material, plus an optional PDF drawing. Billable, only if the calculation succeeds; a retry with the same `idempotency_key` within 24 hours returns the first answer, unbilled. | write |
| `get_upload_link` | A link to the ARCNM upload page that works without signing in, for the person to open in a browser when the file is on their computer. Answers `upload_session_id`, so `list_calculations` finds exactly the calculations they start. Free to issue; each part uploaded through it is billable, only if its calculation succeeds. | write |
| `quote_part` | Prices a part that is already in ARCNM again, at another lot size, material or environment; several `costing_environment_ids` start a batch. Billable, only if the calculation succeeds; a retry with the same `idempotency_key` within 24 hours returns the first answer, unbilled. | write |
| `get_calculation` | One calculation: its `status` to poll, `eta_seconds` while it runs and, once priced, its result with its `analytics` (cost decomposition, price band, material, assumptions, process plan, review), the currency it was computed in (`environment_currency`) beside the one it is quoted in (`currency`), and every exchange rate it converted at (`fx`: rate, date, where it came from, what it converted). The bulk that has a tool of its own — the lot-size curve (`optimize_lot_size`), the cost sheet (`get_cost_breakdown`), the time breakdown (`get_process_plan`), the cost drivers (`explain_cost` ranks the top ones) and an assembly's BOM rows — is left out and named in `analytics_omitted`; `include_analytics=true` returns the whole object. | read |
| `list_calculations` | Finds calculations, by part, batch, status, `created_after` or `upload_session_id`. | read |
| `cancel_calculation` | Stops a calculation that is queued or running. A cancelled calculation is never charged. | write |
| `explain_cost` | Headline cost and times, the prediction band, the breakdown, the machine, the route and how many times each machine clamps the part, work the drawing asks for that is not in the price (and whether the price is complete or partial), and the top cost drivers. | read |
| `get_cost_breakdown` | The itemised cost sheet as one hierarchy, sliced per persona, at any lot size. | read |
| `get_process_plan` | The ordered routing with work centers, cycle times and clampings, then the post-machining chain, plus work the drawing asks for that no machine here can do and whether the price is complete or partial. | read |
| `preview_cost` | Re-prices a calculation with factors moved or at another lot size. Unbilled; writes nothing. | read |
| `optimize_lot_size` | The total-cost optimal lot size, its saving and the cost-vs-quantity curve. | read |
| `suggest_cost_savings` | Every cost-reduction direction for a calculation, each with its lever and confidence. | read |
| `compare_calculations` | Two calculations: the offer-price delta. Three to twenty: a ranking by offer price. | read |
| `list_environments` | The organization's costing environments. | read |
| `check_quota` | The organization's remaining calculation quota and how overage settles. | read |

Three writes start or stop a calculation, `get_upload_link` issues a
link that lets a person start them, `precheck_part` stores a file to read
it before anything starts, and `attach_drawing` gives a drawing to its part,
before the start or after it. None deletes anything. Every
description says what the call costs, when to use it and which tool fits
better, and every argument is described.

## Toolsets

Every other tool belongs to one optional toolset. Name the toolsets you want,
comma-separated, in the `X-MCP-Toolsets` request header, or send `all`.
`default` is always included, names are case-insensitive, and an unknown name
is ignored. There is no query-parameter form.

| Toolset | Tools | What it adds |
|---|---|---|
| `default` | 18 | The tools above. Always listed. |
| `uploads` | 12 | Direct upload (`presign_upload`, `confirm_upload`); list, update, retry, cancel and delete uploads (one or in bulk), an upload's download link, and a CSV or Excel upload read back as rows. |
| `calculations` | 34 | Create, run and delete calculations separately, batches, bulk cancel / retry / delete, assembly BOMs and routes, cost scenarios, the precheck's own routes, `get_cost_drivers` and `compare_environments`. |
| `parts` | 20 | `create_part`, `list_parts`, `list_part_revisions` and `attach_upload`; read, update and delete parts, revisions and datasets; preview, face and drawing links; part-number resolution. |
| `environments` | 57 | `get_environment`, `get_cost_factors` and `apply_adjustment`; creating and cloning environments, archiving and restoring one, setting the organization's default environment, machine / tool / subcontractor memberships, rate rows, material, scrap and subcontract prices, the base price of several stock items at once, economics, tuning, restores, and the workspace's installed environments and their follows in one read (`environments_list_environment_follows`). |
| `nesting` | 7 | Job nests: `create_nest_run`, `start_nest_run`, `cancel_nest_run`, `release_nest_run`, `get_nest_run`, `export_nest_layout` and `get_nesting_summary`. |
| `catalog` | 73 | Materials and stock formats, your own raw-material items (list, check, add, edit and stop buying them), what you state on a standard item (in stock, your article number and lead time, hide and show), the cutting-tool library and catalogue and your tools' own cutting data, subcontractors, the machine library. |
| `calibration` | 22 | `import_history` and `get_calibration_status`: calibrate from your own history and read the accuracy, run by run. Also fits from outcomes and ERP rows, reports, reverting a run, withdrawing a stated time, the master-data import previews and the header map of your article list. See [Calibrating from your history](#calibrating-from-your-history). |
| `setup` | 6 | `get_environment_setup`, `import_setup_data`, `edit_environment` and `create_environment`: build a costing environment from your own lists and settings, each write planned first. `get_raw_material` and `edit_raw_material`: decide which raw material it calculates with. See [Setting up your shop](#setting-up-your-shop). |
| `folders` | 8 | Folders and moving parts between them. |
| `regional` | 23 | `find_environments`, `get_region_drivers`, `preview_reprice`, `get_landed_cost` and `diff_environments`: find an available environment by cost region, read a region's reference values, estimate what a re-price would move, price the delivered cost and see what moved between two versions — free reads that price, save and bill nothing. Also the read tools of the available environments, cost regions and their drivers, logistics profiles, market alerts, market events and publications (the `catalogue`, `regions`, `drivers`, `logistics`, `alerts`, `market` and `publications` families). |
| `account` | 3 | `whoami_whoami` (`GET /whoami`): who the calling credential is — its organization, kind, scopes, plan and default costing environment — for every credential. Your own identity (`GET /users/me`, `/users/me/context`), for a signed-in app session only. |

```bash
# one header, any MCP client
X-MCP-Toolsets: calculations,catalog
X-MCP-Toolsets: all
```

**A grant can select a toolset too.** A client that sends no custom header —
ARCNM installed from the Claude directory or as a ChatGPT app, signed in
with OAuth — reaches a toolset through the scopes the person grants on the
consent screen: a grant that names `setup:write` lists the `setup` toolset,
and one that names `calibration:write` the `calibration` toolset, on top of
the default tools. The scope has to be
named: `parts:write` covers the same calls but selects nothing extra, so a
pricing grant's list does not grow by itself. The consent screen leaves
`setup:write` and `calibration:write` unchecked until the person ticks them.

**What you can call is what you list.** A tool outside your toolsets is left
out of `tools/list` and answers `not_found` when called, exactly like a name
that does not exist; select its toolset and it is listed and callable, under
the same scopes, tenancy and REST checks as any other tool. The scope filter
below applies on top: a toolset never lists a tool your credential cannot
call.

### Moved in 4.0.0

Version 4.0.0 (2026-11-03) adds two tools to the `calibration` toolset:
`import_history` and `get_calibration_status`. Five tools they replace are
no longer listed. Their REST routes are unchanged.

| Tool before | Now |
|---|---|
| `calibration_import_create` | `import_history` with the history (rows, csv or data_source_id) |
| `calibration_import_status` | `import_history` with `import_id`, or `get_calibration_status` with `import_id` |
| `calibration_import_calibrate` | `import_history` with `import_id` and `apply=true`, once the import is priced |
| `calibration_environment_status` | `get_calibration_status` |
| `calibration_environment_run_history` | `get_calibration_status` (the latest 10 runs) |

`import_history` also prices an import. No tool reached that step before.

### Moved in 3.0.0

Version 3.0.0 (2026-10-14) cut the default list from 31 tools to 15. A tool
keeps its name when it moves to a toolset. `upload_and_quote` (the JSON
upload-and-quote, `calculations_upload_and_quote_json` before) joined the
default list. These moved out of it:

| Tool | Toolset now |
|---|---|
| `presign_upload`, `confirm_upload` | `uploads` |
| `create_part`, `list_parts`, `list_part_revisions`, `attach_upload` | `parts` |
| `get_cost_drivers`, `compare_environments` | `calculations` |
| `get_environment`, `get_cost_factors`, `apply_adjustment` | `environments` |
| `create_nest_run`, `start_nest_run`, `cancel_nest_run`, `release_nest_run`, `get_nest_run`, `export_nest_layout`, `get_nesting_summary` | `nesting` |

`explain_cost` ranks the cost categories and then the cost drivers that
`get_cost_drivers` ranks, an assembly's components included, so the default
list needs only one of them.
Send `X-MCP-Toolsets: all` to list every tool as before.

### Renamed and removed in 2.0.0

Version 2.0.0 (2026-10-12) renamed the default tools and dropped the `arcnm_`
prefix. There are no aliases: a call to an old name answers the protocol's
unknown-tool error. The full old → new mapping is in the
[changelog](./changelog.md#2026-10-12).
Seven tools left the MCP surface because a default tool answers the same
question: `calculations_get_entitlement` (`check_quota`),
`calculations_get_calculation_optimization` (`suggest_cost_savings`),
`calculations_preview_cost` (`preview_cost`),
`environments_get_environment_factors` (`get_cost_factors`),
`calculations_get_cost_sheet` (`get_cost_breakdown`),
`calculations_batch_comparison` and `calculations_compare_environment_runs`
(both `compare_environments`). Their REST routes are unchanged.

### What the cost and nesting tools return

The cost and nesting tools are built for an agent's cost-optimisation loop.
Each returns a **concise, structured** result (with an `outputSchema`)
instead of the full response blob, so they're cheap on context:

| Tool | What it returns |
|---|---|
| `explain_cost` | Headline unit / total / setup cost **and setup / cycle / unit time**, the prediction band, the cost breakdown, the machine used, the route and how many times each machine clamps the part, work the drawing asks for that no machine here can do (each process and why it is not in the price, with the codes that keep it out and the remedies that would put it in) and `price_completeness` (`partial` makes the unit cost a lower bound), the material-resolution assumption, and the top cost drivers: the cost categories first (setup, subcontract, material, machine …), each with its share of the unit cost and the categories not listed in one `other` row, so the shares add up to 100 %; then the features, which split the run-time categories. The top 3 of each, or 10 with `detail="detailed"`. On an assembly the drivers are its components and its own joining. |
| `get_cost_drivers` | The top cost drivers, ranked — each with its cost, its share of the unit cost, and why it's costly. |
| `get_cost_breakdown` | One calculation as a single rough-to-detailed hierarchy — headline → cost category → operation → feature, time and cost side by side — with a `persona` knob (`procurement` / `workprep` / `operations` / `design` / `full`) that returns just the slice that persona needs. Every persona also gets `material_stock`: the stock the part is bought as (format and who chose it, size and what the part measured, parts per stock, a compound's pieces), where its metal goes (`purchased_mass_kg` = `part_mass_kg` + `scrap_mass_kg` + `remnant_mass_kg`), and the material line as the stock bought less the scrap and remnant credits — the same stock `analytics.material_resolution.stock` names and the same amounts the cost sheet shows. |
| `get_process_plan` | The ordered process plan (routing) all the way to a finished part: the machining steps, each with its process, work center and cycle time, then the post-machining chain (welding, heat treatment, surface finishing, coating) in the order it is performed — plus the plan-level setup / cycle / total time, the machine(s), and how many times each machine clamps the part. Also the processes the drawing asks for that no machine in the environment can do, each with why it is not in the price. The work plan a work-preparation user acts on. Post-machining steps carry no cycle time: they are priced per lot, in the subcontract line. |
| `compare_calculations` | Takes 2 to 20 `calculation_ids`. With two: the offer-price delta between them (the price each one headlines, cost-sheet surcharges included), with the unit-cost delta before surcharges beside it, flagging when they aren't comparable (different lot size / environment). With three to twenty: ranks them by offer price, lowest first, each with its premium over the cheapest and time beside cost, flags when they aren't like-with-like, and lists blocked / unpriced calcs last. |
| `compare_environments` | The parts × environments matrix of a multi-environment run — per part the offer price in every environment (with the unit cost before surcharges beside it), in its own currency and in your organization's reporting currency (`reported_offer_prices`, at the reference rate of each cell's own costing date; a cell no rate translates is in `fx_unavailable_environment_ids` and is not compared), and the environment with the lowest offer price (ties included); per environment the win count, basket total and median delta vs the baseline, all on the offer price in the reporting currency (`reporting_currency`). Pass a `batch_id` (from a multi-environment quote/batch) or an ad-hoc `calculation_ids` list; all figures are server-computed, identical to the REST comparison endpoints. Up to 200 ids, and the pivoted grid may not exceed 500 cells (parts × environments). |
| `optimize_lot_size` | The total-cost optimal lot size (production plus inventory holding, capped at one year of demand), the net EUR/yr saving of moving there, the Andler/EOQ cross-check, the cost-vs-quantity curve (each point with its `offer_price` as well; exact at the quoted lot, `exact_at_quantity`, and indicative at every other one, by as much as `accuracy` states — `preview_cost` prices another lot firmly), at most two lot-size/setup directions — and every scenario's answer on the same curve (`scenarios`): the buyer holding stock with its cost per order or delivery, the supplier producing ahead at its finite rate, delivered to order, the joint frame-contract call-off with the supplier's lot behind it, and the same frame contract under consignment (supplier-owned stock at the buyer's site until use). |
| `suggest_cost_savings` | Every optimization direction for a calculation — lot sizing, setup reduction, tolerance-cost review, material utilization, external-process benchmarking, plus the live supplier-quote gap — each tagged with its lever, confidence, and method. |
| `get_cost_factors` | Every number a costing environment lets you change — each factor's effective value, where it came from (your own statement, inherited, learned or the platform default), the band a what-if may explore, the cost-sheet lines it moves and the endpoint that saves it. Read it before proposing anything. |
| `preview_cost` | Re-prices a calculation with factors moved (and/or at another `lot_size`) and returns the whole cost sheet plus the change per category — a genuine re-price through the same engine, **unbilled**: it creates no calculation, changes neither the calculation nor the environment, and consumes none of your included calculations. Refuses by name (`details.reason`) rather than answering approximately; see the cost-sheet codes in [Errors](./errors.md). Counts as a heavy request against the rate limit. |
| `apply_adjustment` | **A write**, annotated `destructiveHint=true`. Makes a what-if stick the way the app's "apply to this environment" dialog does: by default it only PLANS (every REST write it would make, today's value, the new one, and what it refuses by name — a machine's own rate, cutting data, the lot size); `apply=true` performs them under `parts:write`; `recalculate=true` also starts a (billable) calculation on the changed environment — asked what this one was asked (its material supply, the grade the caller chose, currency, dataset, language and stock format), recorded as derived from it, created with an `Idempotency-Key` so a retry replays rather than re-bills — and reports in `recalculation_status` what running it answered; a refusal after the environment was changed comes back under `refused`, beside the writes. Not idempotent itself: a base-seconds knob is *taught* as one calibration observation per apply. |
| `create_nest_run` | **A write.** Nests a backlog of sheet-metal parts together — several orders, materials and thicknesses at once — from calculations (each with an optional quantity, order, due date and priority), a batch, or a folder, all priced in one costing environment. By default it only PLANS: the lines and copies of each material and thickness, the remnant pieces of it in stock, and what a batch or folder leaves out and why — nothing is started. `apply=true` starts the job nest under `parts:write`, with an `Idempotency-Key` keyed on the request, so the same call within 24 hours answers the job nest it already started. A job nest takes every remnant it cuts from out of stock and puts its reusable rests in, so it is annotated `destructiveHint=true`. It never changes a calculation's own price. The plan and the start each count as a heavy request against the rate limit. |
| `start_nest_run` | **A write.** Starts a job nest that was kept as a draft — one `create_nest_run` stored, not queued, while this month's runs were used; a draft never starts by itself. By default (`apply=false`) it only reads the job nest and says whether it is a draft and what starting it would nest. `apply=true` (needs `parts:write`) queues it once: it spends one of this month's runs and is nested at today's stock and prices — poll `get_nest_run`. While the month's runs are still used the start is refused and the draft stays; only a draft starts, and only once. |
| `cancel_nest_run` | **A write.** Stops a job nest that has not ended — queued, running, or kept as a draft. By default (`apply=false`) it only reads the job nest and says whether it can be cancelled. `apply=true` (needs `parts:write`) cancels it: the materials and thicknesses already nested keep their result, the others are cancelled, and every remnant it holds goes back to stock. Cancelled before any material and thickness is nested, it gives its run back to this month's allowance; once one is nested, it counts as a run. A draft is discarded. A job nest that has ended is not cancelled again. |
| `release_nest_run` | **A write.** Releases a job nest that has ended (solved, failed or cancelled), when its sheets are to be cut for real — the step an agent running the cutting line or order processing takes after `get_nest_run` and `export_nest_layout`. By default (`apply=false`) it only reads the job nest and says whether it can be released, whether it is released already and what it saves. `apply=true` (needs `parts:write` and the Nesting add-on) releases it: the remnants its sheets are cut from leave stock, the reusable rests its sheets leave go in, what it saves adds to the total saved by nesting, and its sheets are frozen. It answers the saving and the remnants it moved. A release cannot be undone. It is refused while the job nest is a draft or still running (`nest_run_not_editable`), or when a remnant it planned to cut is no longer in stock (`nest_run_remnant_unavailable`). Releasing a released job nest books nothing. |
| `get_nest_run` | How far a job nest has got: its status, how many of its materials and thicknesses are done, and each one's status, sheets and utilisation so far. Once the run is solved, the same call adds what it came to: the sheets of each material and thickness with their utilisation, each order's and each line's share of the sheets (bought, less what the skeleton sells for as scrap and the reusable rests are worth back in stock, in total and per copy — a line's per copy is what a calculation priced on it pays, less where the part's own sheet holds it more densely), what a batch or folder left out, and the remnants it used and created. Each line carries its `line_id`: create a calculation of the part with `nest_item_id` set to it to price the part's material on its line. `detail="concise"` lists the first 50 lines, `detail="full"` every line. |
| `get_nesting_summary` | Takes no arguments. What nesting the organization's sheet quotes of the last 90 days together on shared sheets would save, and how many nesting runs are used and how many remain this month (none without the add-on: no run starts then). The figure is a lower bound against each part on its own sheet as its quote priced it, floored without the Nesting add-on, and never one quote's price or a layout. Beside it, the organization's total saved by nesting — the released job nests' savings summed: the sheet their lines buy cut from rectangular blanks, with each part nested alone and nested together, what nesting saved against rectangular blanks and its split into each part's true shape and the orders nested together, money per currency and kg — and, apart from it, the potential of the job nests that ended as simulations. A job nest counts once it is released, with `release_nest_run` or in the app. |
| `export_nest_layout` | Takes exactly one of `run_id` and `calculation_id`; both or neither is refused with an error that says so. With `run_id`: the cutting files of a job nest's sheets — every solved material and thickness, each distinct layout once with how many identical sheets it stands for. `format="json"` (the default) answers the nest plan inline (every part's contour and holes in millimetres, every sheet's container, material, thickness, allowances and placements; past 256 KB without the contours) and its download link; `format="dxf"` or `"svg"` answers each sheet's download link — the same `GET /nest-runs/{id}/export` the API serves, to fetch with the API key — and nothing inline. `sheet="all"` covers every sheet (the DXF/SVG link is a zip with `plan.json` and `manifest.csv`), `sheet="<group>:<index>"` one sheet. `exploded=true` asks for DXF polylines in place of blocks. With `calculation_id`: the cutting file of the sheet a calculation's own price laid its part out on — the part alone, as many copies as its price put on one sheet — with the same `format` and `exploded`. A calculation that stored no sheet layout, or that is not cut from sheet, has nothing to export. See [Cut a job nest](./recipes/cut-a-job-nest.md). |
| `get_upload_link` | **A write**, annotated `destructiveHint=false`. Issues a login-free [upload link](./uploads.md#upload-links) for the person to open in their browser — the upload path when this client cannot send file bytes (the presigned `url` is unreachable from its network, or the files are on the person's computer). Scoped to a folder and a costing environment (the organization's default when none is named), both checked to exist, and to `max_uploads` parts (1 to 20, default 1); it works for 30 minutes. Answers `upload_session_id`: `list_calculations` with `upload_session_id` set to it lists exactly the calculations the person starts there, and no one else's. Needs `parts:write`; a read-only server issues none. |
| `check_quota` | This organization's remaining calculation quota for the current window — included / used / remaining, the overage rate, how overage settles (`wallet` = prepaid, with `wallet_funded_calculations` telling you how many more fit), and whether billing is suspended — so you can check before committing a run instead of parking a calc as `blocked`. |
| `find_environments` | Searches the available environments — the published costing environments every organization may install and follow — by cost region (`region`: a code or alias such as `DE`, `DE-BY`, `EU27`; environments in that region or any region beneath it, and for a region within a country, the ARCNM environment of that country — ARCNM publishes one per country) and machine coverage (`process_families`, all of which must be covered). Each result carries its id, region, currency, fleet size, current version and channels, token-light, and for a platform environment its `grade` (`complete` or `provisional`) with the provisional values named; the guidance says when a result is provisional. Each also carries a `preview` of its current version's setup (the labour and energy figure it prices with and where it comes from — each with its `reported` figure in your organization's reporting currency at today's reference rate — machines by class, materials priced, wage groups, overheads, exchange rates) and `in_workspace` — the environments of your organization that already follow it, which the guidance points out. An ARCNM one is installed with `create_environment` (`start_from: "preset"`); a country your organization does not price in yet is an owner's or admin's to take. |
| `get_region_drivers` | A cost region's reference values at a date — labour, energy, capital, overhead, working time, the region's own exchange rate and carbon — the values an environment bound to that region prices with wherever it states no rate of its own. Each names the region that answered (its own or a parent's), its method, source line, validity date, whether it is `stale` (past its refresh deadline — for a value derived from a statistic two missed prints of its newest input, else twice its refresh cadence; it still prices) and whether it is `provisional` (`unverified_estimate` or `subnational_scope`; the guidance says so). A value licensed for use in a price only (`derived_only`) is named without its value, band or source line, and `withheld` counts them. `detail="detailed"` returns every value (materials, freight lanes, packaging, lead times); `as_of` reads another date — the platform does not forecast. |
| `preview_reprice` | A free, first-order estimate of what re-pricing a calculation would move — against its environment's current version and today's reference values, one named `version_id`, or the values valid on a past `costing_date` — from the cost shares the calculation stored: the unit cost before and after at the ordered lot and the drivers that move it, largest first. Nothing is priced, created or billed; the re-price itself is started by a person in the workspace. |
| `get_landed_cost` | The delivered cost per part of a priced calculation — ex-works plus packaging, freight, insurance, duty, CBAM and customs brokerage at the ordered lot, with who bears each line under the incoterm. Name a `destination_region` (optionally with `origin_region`, `incoterm`, `mode`) to price a destination without saving anything, or a `logistics_profile_id`; with neither, the calculation's own profile, its part's folder default or its environment's default applies. It sits beside the price and never changes `unit_cost`; free and never saved. |
| `diff_environments` | What moved between two versions of a costing environment, ranked largest move first: an available environment's published versions; for an environment that follows one, the three-way view (the applied version, the pending one and your own statements — which moves reach your prices, which you override, which conflict and need a person to resolve); for your own environment, its own versions. Versions are named by label or id; with neither, the two newest (or, for a following environment, the applied version against the pending one). |

`get_cost_drivers` and `compare_environments` are in the `calculations`
toolset, `get_cost_factors` and `apply_adjustment` in `environments`, the
job-nest tools in `nesting`, and `find_environments`, `get_region_drivers`,
`preview_reprice`, `get_landed_cost` and `diff_environments` in `regional`.
All but `apply_adjustment`, `create_nest_run`, `start_nest_run`, `cancel_nest_run`, `release_nest_run` and `get_upload_link` are read-only, and every one inherits the same scopes, tenancy, and redaction as
the REST API — ideal building blocks for a "cost it, find the drivers, change
the design, re-cost, compare" loop driven from a CAD/agent toolchain.

Every one of these tools that quotes a calculation's price or a saving derived
from it — explain, drivers, breakdown, lot size, optimization directions, and
each side of a comparison or ranking — carries
`environment_changed_since_run` and `inputs_changed_since_run`, the same two
facts the calculation carries over REST. Null means the price reflects its
costing environment, its part's files and the corrections saved to the part
as they stand. When either is set,
the price predates an edit, the tool's guidance says so, and a new
calculation of the part revision prices with the current setup (running the
same calculation again changes nothing).

The five regional-costing tools are free, analytic reads. Each composes the
public REST reads with your own credential, so scopes (`parts:read`),
tenancy, licence gating and the public projection apply unchanged, and none
of them prices, saves or bills anything. Installing an available
environment, applying an update, re-pricing, saving a logistics profile and
publishing an environment stay with a person in the app: those
writes are denied by operation id and by path, so no tool reaches them.

### Reads are tools too

Everything you need to *read* — a full calculation (poll
`get_calculation` for its `status`), an environment and its machine
fleet / rates, a part's revisions, the material catalogue — is a **read-only
Tool** in the same `tools/list` as the writes (look for `readOnlyHint=true`), so
there is no second surface to discover. There is no separate job-status tool — a
calculation carries its own `status`, so polling `get_calculation`
is the deterministic way to wait for a result.

### Errors and pages

A failed tool call returns `isError: true` with the **API's own error
envelope** — the `{"error": {"code", "message", "details", "doc_url"},
"request_id"}` body the REST API answers — as the result's JSON text. Parse
the text; an error result carries no `structuredContent`, because
`structuredContent` must match the tool's `outputSchema` and an error
envelope does not. That holds for the generated tools and the curated
cost and nesting tools alike. Switch on `error.code`, and on `details.reason` where
[Errors](./errors.md) names one; never on the message. Quote `request_id`
when you report a problem.

Every list tool that takes a `cursor` states the next page in its result.
Most collections answer an object with `next_cursor` and `has_more` over REST
already. The ones that answer a bare list over REST and page in the
`X-Next-Cursor` / `X-Has-More` headers (uploads, environments, tools, stock
formats, the machine library) answer `{"data": [...], "next_cursor": ...,
"has_more": ...}` over MCP, because a tool result carries no headers. Pass
`next_cursor` back as `cursor` until `has_more` is `false`; never stop on a
short page.

### Getting a CAD file in over MCP

An MCP client sends JSON arguments, and a file cannot ride in one as a
multipart part. So the multipart upload routes — `POST
/calculations/upload-and-quote`, `POST /calculations/{id}/inputs` and the
revision's `datasets/upload` — are **not MCP tools**. Use their JSON paths:

- **Upload and quote in one call:** `upload_and_quote` (`POST
  /calculations/upload-and-quote-json`, a default tool) — the same one-shot
  upload + quote, but the CAD (and optional drawing / RFQ) ride as **base64
  (or `data:` URI) strings** in a JSON body. A single part may be up to
  5 MB and an assembly up to 25 MB ([CAD size limits](./uploads.md#cad-size-limits)).
  Base64 inflates ~33% and rides inside the tool call, and one call carries at
  most 16 MB: send a large STEP gzip-compressed, about five times smaller.
  Follow the calculation it answers with `get_calculation`.
- **When the file is on the person's computer:** `get_upload_link` answers a
  login-free link to the arcnm upload page, scoped to a folder and a costing
  environment (both checked to exist) and to `max_uploads` parts, with its
  `upload_session_id`. Some clients cannot reach the storage host a presigned
  `url` points at, and a file on the person's computer never reaches the
  model in the first place. The person opens the link — no account needed —
  drops the STEP and PDF files, and arcnm files and prices each part.
  `list_calculations` with `upload_session_id` then lists exactly those
  calculations. The link works for 30 minutes; whoever has it can upload, so
  it goes to that person only ([what a link can and cannot do](./uploads.md#what-a-link-can-and-cannot-do)).
- **Any file, any size** (the `uploads` and `parts` toolsets):
  `presign_upload` → send the file to the `url` it answers the way its
  `method` says → `confirm_upload`. `method` is `PUT` (the file's raw bytes
  as the body, with the `headers` it names) or `POST` (a
  `multipart/form-data` form with every entry of `fields`, then the file as
  the last field, named `file`); branch on it, because a file sent the other
  way never arrives. `confirm_upload` answers `status` `pending` — the file
  is checked after it answers — or an error with `details.reason`
  `upload_not_received` when no file has arrived yet. To add a drawing, mesh
  or RFQ text to a part revision (what `POST /calculations/{id}/inputs` does
  over REST), attach the upload with `attach_upload` and its `role`: until
  the check is done it answers an error with `details.reason`
  `upload_pending` and `details.retry_after_s` — wait that long and call it
  again (calling `confirm_upload` again answers the current `status` too).
  When no file ever arrived it answers `upload_not_received` instead, as
  `confirm_upload` and `uploads_retry_upload` do: send the file first. A
  check that failed or refused the file is named by the upload's
  `failure_reason`. The next calculation you run on that revision reads the
  file.
- **A drawing for its part, whatever the files are called:**
  `attach_drawing` (a default tool) takes exactly one target and exactly one
  drawing — `data_source_id` of a stored drawing, or the file itself as
  `drawing_file_b64` with `drawing_filename`. A wrong combination is refused
  before anything is sent. By default (`apply` false) it plans: it reads the
  precheck or the calculation, says what would change and attaches nothing;
  `apply=true` attaches.
  - *Before the run*, on a precheck: `precheck_id` and the `component_key`
    of one of its rows (`get_precheck`), or `assembly` for the assembly's own
    drawing. A drawing the precheck holds moves there (`PATCH
    /prechecks/{precheck_id}`); a new file is stored with the precheck (`POST
    /prechecks/{precheck_id}/drawings/json`, the JSON twin of the multipart
    `…/drawings`). The drawing goes with that part when `upload_and_quote`
    starts the precheck, and nothing is billed before the start. A precheck
    answers its parts once it is read (`status` `ready`); a `component_key`
    it does not hold answers `component_not_found`, a started or discarded
    precheck `precheck_closed`.
  - *After the run*, on the part's own calculation: `calculation_id` (`POST
    /calculations/{calculation_id}/drawing`, also `calculations_assign_drawing`
    in the `calculations` toolset) makes the drawing the drawing of the part
    the calculation prices — `data_source_id` from `confirm_upload`, or the
    file itself; a drawing a precheck holds that has not started answers
    `drawing_in_precheck`, as it goes with that precheck if nobody starts
    it — and prices the part again with it, through the same path
    as `quote_part`: a new calculation on the same revision, environment and
    lot, answered in `new_calculation`, whose `status` says whether it runs
    (`queued`) or waits on billing (`blocked`). The same drawing again answers `changed` false and runs
    nothing; `run` false attaches without pricing. A component of an
    assembly is priced again in place (`rerun_calculation_id`), billable
    the same way. An
    assembly's own drawings go through the drawing pack (`POST
    /calculations/{calculation_id}/drawings`, REST only).

  It is a write (`destructiveHint` true): it moves a drawing off the part it
  went to, replaces a calculated part's drawing and may start a billable
  run. So it plans by default and writes only on `apply=true`; it needs
  `parts:read` and `parts:write`, and a read-only server plans but attaches
  nothing.

### Finding a material

Both tools are in the `catalog` toolset. `materials_lookup` resolves an exact reference; on a near-miss it now returns the
closest grades in the error detail. For a fuzzy "did you mean" list that never
dead-ends — a partial code, a trade name, or a generic term like *Stahl* —
use **`materials_suggest`**, then pass a candidate's `urn` back as `material_ref`.

### Your own raw-material items

The bars, tubes, sections, sheets and custom profiles you buy are yours to
manage, in the `catalog` toolset. The reads need `parts:read`, the writes
`setup:write`.

| Tool | REST | What it does |
|---|---|---|
| `list_stock_items` | `GET /stock-items?scope=own` | Your items with their designation, dims, section area, delivered lengths, article number, whether they are stocked and their lead time. |
| `stock_items_get_stock_item_schema` | `GET /stock-items/schema` | The shapes an item can be, each with its dims and base unit, and the delivery conditions and material groups an item may name. Read it before you add an item. |
| `validate_stock_item` | `POST /stock-items/validate` | Checks one item before you state it: the normalised dims, the designation, the section area and the nominal mass, or why the item is refused. Nothing is stored. |
| `stock_items_create_stock_item` | `POST /stock-items` | Adds one item, bought from today. The same item a second time answers `stock_item_exists`, so a retry adds nothing. |
| `stock_items_get_stock_item` | `GET /stock-items/{item_key}` | One item as it stands. |
| `stock_items_update_stock_item` | `PATCH /stock-items/{item_key}` | Changes what you state about buying it: article number, stocked, lead time, delivered lengths, tolerance, surface. What the item is — shape, dims, standard, condition, material group — does not change: add the other item and stop buying this one. |
| `stock_items_stop_stock_item` | `POST /stock-items/{item_key}/stop` | Stops buying it from today. An item is never deleted: a calculation that names it keeps it. |

### What you state on a standard item

The standard items are listed per costing environment, by designation,
shape, standard and nominal mass — see
[Raw material of an environment](#raw-material-of-an-environment). Each has
an `item_key`, and with it you state what your shop states on the item, in
the `catalog` toolset. Every write needs `setup:write` and answers the
item's designation and your own statement.

| Tool | REST | What it does |
|---|---|---|
| `stock_items_set_standard_items_stocked` | `POST /stock-items/standard/stocked` | Whether you keep up to 500 standard items in stock, in one write. All of them or none. |
| `stock_items_set_stock_item_override` | `PUT /stock-items/{platform_item_key}/override` | What you have differently on one item: in stock, article number, your supplier's reference, lead time, a tighter tolerance, the lengths you buy, your own name for it. The statement is whole: a field left out takes the standard value, and an empty one removes it. |
| `stock_items_hide_stock_item` | `POST /stock-items/{platform_item_key}/hide` | Hides an item your shop does not buy, for your organization, from today. |
| `stock_items_unhide_stock_item` | `DELETE /stock-items/{platform_item_key}/hide` | Shows it again. |

Your whole article list goes in at once with `import_setup_data` and
`kind: stock_items`: a row that names a standard item sets your article
number and the rest on it, any other row adds an item of your own.
`import_preview_stock_item_import` (`POST /import/stock-items/preview`)
reads the same list without writing, and
`import_get_stock_item_header_map` / `import_put_stock_item_header_map`
keep your column names for the next import.

A standard item's dimension table, its section properties and where its
values come from are read in the app only. The routes that read them — the
standard list, the lookup by designation, copying a standard item into one
of your own and comparing the copy — answer `403 first_party_required` to
an API key or an agent's grant, and are not tools.

### Setting up your shop

The `setup` toolset lets an agent build your costing environment from the
lists you already keep: machine park, tool crib, material price list,
subcontractors and their prices, stock formats, and your own cutting data.
A grant that names `setup:write` lists it. So does `X-MCP-Toolsets: setup`.

- **`get_environment_setup`** reads what an environment holds, in one
  answer: economics, machines with their rates (`hourly_rate` and
  `rate_operator_per_h` in the machine's `rate_currency`), tools per kind,
  subcontractors and their operations, labour, overhead and subcontract
  prices, and how many material prices of your own it holds.
  It also lists the **gaps** that leave a price on platform references:
  `machine_without_rate`, `operation_without_price`, `no_labour_rate`,
  `no_material_prices`, and `rate_not_applied` (a stored rate the engine
  cannot apply, with the reason). For an environment that follows an
  upstream environment, a gap names what prices instead: the followed
  version (its name and version label), the region's reference value where
  the environment reads them, the platform reference, or nothing (a placed
  machining step no price covers is priced in house). Read it before and
  after a change. It is read-only and free.
- **`import_setup_data`** imports a whole list at once.
  - **Kinds:** `machines`, `tools`, `stock_items` (your article list of raw
    materials), `material_prices`, `subcontractors`, `subcontract_prices`,
    `stock_formats` and `cutting_data`.
  - **Input:** send the list as `rows` (JSON objects keyed by column name),
    as `csv` text, or as `data_source_id`. A `data_source_id` is a `.csv` or
    `.xlsx` file you uploaded with `presign_upload` and `confirm_upload`,
    with `sheet` to pick a worksheet. It is read exactly as the file has it,
    so nothing is retyped. Send `X-MCP-Toolsets: setup,uploads` to list
    those two tools; reading the upload needs `uploads:read`.
  - **Columns:** names are matched tolerantly, German ones included
    (`Werkstoff`, `Preis €/kg`, `Lieferant`, `Stundensatz`, …). Columns a
    kind does not read come back in `unmapped_columns`.
  - **A machine list reads the whole machine sheet.** See
    [Machine lists](#machine-lists) below.
- **`edit_environment`** makes single changes in one changeset:
  - economics (margin, overheads, scrap credit, …), by the names
    `PATCH /environments/{env_id}/economics` takes (`scrap_credit_per_kg`,
    `freight_per_part`, …)
  - a machine's rates, by the names `PATCH /machines/{machine_id}` takes
    (`hourly_rate`, `rate_operator_per_h`, `setup_rate`,
    `programming_rate`, `burden_rate`)
  - enabling or detaching a machine, tool or subcontractor
  - a subcontractor's details
  - a labour, overhead or currency rate
  - a scrap price, or clearing a material price
- **`create_environment`** starts a new environment from one of these:
  - a copy of your auto-provisioned environment, in its currency (another is refused with `baseline_currency_mismatch`: install that country's environment instead)
  - one of your environments
  - a preset — an ARCNM country environment, installed as Install in the app installs it: it follows the latest release and applies each one when asked. A country your organization does not price in yet takes one of your plan's countries, which only an owner or admin takes, or an API key with `countries:write` (`country_slot_requires_admin` to any other API key)
  - every tool and no machines
  - nothing

  Its `currency` is the one the environment states its own figures in. Its
  `presentation_currency` is the one its new calculations are quoted in,
  translated at the end; omitted, they are quoted in its `currency`. A
  currency the environment has no exchange rate to is refused with
  `currency_not_configured` once the environment is made.

**Nothing is written without a plan you saw.** `import_setup_data` and
`edit_environment` plan by default, without writing:

- Each row or change gets its action (`create`, `create+attach`,
  `attach-existing-by-name`, `set`, `unchanged`, `skip-duplicate`, `error`).
- Each shows today's value against the new one.
- Each refusal comes with its reason.
- A changeset's plan tries every write on the route that makes it and rolls
  all of it back. A value the write would be refused for — a percentage
  sent as `12` instead of `0.12`, an unknown overhead bucket, a negative
  rate — is `refused` in the plan, with that route's error `code` and its
  reason. It is not planned and then refused when you apply. (A caller who
  may not write at all gets a plan with unchecked values; applying it is
  refused whole, with `insufficient_scope` or `role_read_only`.)
- The changes of a changeset are tried, and written, in the order you send
  them, each on what the ones before it leave. A machine's operator wage
  above its rate is refused; behind the change that raises the rate it is
  valid. Order them the way you would make them by hand.

The plan carries a `plan_digest`. Send the same input with `apply=true` and
that digest to write exactly that plan. If the list or the environment
changed since, for example because someone set a price in the app, nothing
is written and the answer is the new plan with its new digest.

What an import does depends on the kind:

- Machines, tools, subcontractors and stock formats are only **added**;
  existing ones are never overwritten. Change those with `edit_environment`.
- Prices and cutting data are **set**.
- A refused row fails on its own, with the platform's reason; the others
  are still written.

Applying is **not all-or-nothing**, for a list and for a changeset alike:
each row or change has its own outcome, and the answer counts them
(`written`, `failed`). What the plan refused is not written. `failed` is a
write the platform refused only when it was made — the setup changed in
between — with its `code` and reason; the rows written before and after it
stay written. Plan the failed ones again.

Setup is free. The next calculation in the environment prices with it.

Each tool is the MCP face of a REST route, so an integration without an
agent does the same:

| Tool | REST |
|---|---|
| `get_environment_setup` | `GET /environments/{env_id}/setup` |
| `import_setup_data` | `POST /setup/imports/preview`, then `POST /setup/imports` with `expected_plan_digest` |
| `edit_environment` | `POST /environments/{env_id}/setup/changes/preview`, then `POST /environments/{env_id}/setup/changes` with `expected_plan_digest` |
| `create_environment` | `POST /environments`, `POST /environments/{env_id}/clone`, or `POST /environments/from-catalogue` (a preset); then `PUT /environments/{env_id}/identity` with `presentation_currency` when it is sent |

The platform's own reference values stay in the app: effective rates,
assumptions, and the seed cutting data an environment inherits.

#### From nothing to a priced environment

An agent with one API key (`parts:read` and `setup:write`) sets a shop up
without anyone opening the app. Send `X-MCP-Toolsets: setup,environments,catalog`
and work in this order:

1. **The environment.** `create_environment` with `start_from: "preset"`
   and a region code as `source_id` (`DE`, `US-TX`; or an available
   environment's id) installs ARCNM's environment of that region under your
   name. An unknown code is refused with the codes that install one.
2. **Machines.** `import_setup_data` with `kind: machines` for your machine
   list. For one machine of the library, `machine_library_list_library`
   then `environments_attach_machine` with its `library_entry_id` and your
   own hourly rate.
3. **Tools.** `import_setup_data` with `kind: tools` for your own. For an
   article of the catalogue, `tools_list_catalogue_items` then
   `tools_adopt_catalogue_item`.
4. **Rates and margin.** One `edit_environment` changeset: a `rate` change
   per labour category and overhead bucket, and an `economics` change.
5. **Material prices.** `import_setup_data` with `kind: material_prices`.
6. **Stock.** `import_setup_data` with `kind: stock_formats`, and
   `stock_items_create_stock_item` for each raw-material item of your own.
7. **Subcontracting.** `import_setup_data` with `kind: subcontractors`, then
   `kind: subcontract_prices`.
8. **Read it back.** `get_environment_setup` answers what the environment
   holds; an empty `gaps` list means no price falls back to a platform
   reference for want of a rate. `environments_list_rates` shows each rate
   with the day it applies from, and `environments_get_individualization`
   what the environment states differently from the platform set.

**Running it again changes nothing.** A list sent again plans every row as
`unchanged` or `skip-duplicate`, and a changeset whose values are already in
force plans as `unchanged`: there is nothing to apply. A create is not
checked that way, so give each create a retry key: `create_environment`,
`environments_attach_machine` and `stock_items_create_stock_item` take
`idempotency_key` (so do `environments_create_environment`,
`environments_clone_environment` and `environments_clone_preset`). The same
call with the same key within 24 hours answers what the first call made — the
same environment, not a second one named "… (copy)". The same key with other
arguments is refused with `idempotency_conflict`. Over REST it is the
[`Idempotency-Key`](./idempotency.md) header on the same routes. The other
creates (a tool, a subcontractor, a stock format, a library machine) are
safe to repeat through `import_setup_data`, which skips what you already
have by name.

**A refusal says who must act.** `insufficient_scope`: the credential lacks
`setup:write`. `role_read_only`: the user's role in the organization only
reads. `rate_limited`: wait the seconds it names (`details.retry_after_s`;
`Retry-After` over REST) and send the same call again — nothing of it was
done. A whole setup takes more than one minute's budget on the Free plan:
every written list or changeset is one heavy call, and so is the plan of a
changeset ([Rate limits](./rate-limits.md)). The setup above is about 200
weighted calls against 180 a minute, so an agent waits once; running it
again, with nothing to write, is about 50.
`environment_not_found` and the other `…_not_found` codes: the id is not one
of your organization's.

#### Raw material of an environment

A costing environment holds its own raw material, the standard rows and
your own alike: stock formats (sheet, plate, bar, tube and section lengths)
and stock items (bars, tubes and sections by shape and size). A calculation
chooses its sheet, plate and length from the formats the environment holds,
and a price you state for a stock item applies only while the environment
holds that item. The sizes of bars, tubes and sections follow the standard
size series: today a listed item decides which of your item prices applies
and what a calculation records, not which bar, tube or section size a part
is cut from.

A new environment starts with the standard set — the standard items and
formats every environment starts with — and your own rows; one created as
a copy of your default environment starts with what that environment
holds. The catalogue can hold more than the standard set: standard rows
that are in no environment until you add them. Standard rows published
after an environment was set up are **not** added to it either: they are
counted as new until you add them or mark them as seen, so a release never
changes what an environment prices with.

A calculation's `stock_format_id` and a job nest's `formats` name formats
the environment holds. A format you can use that the environment does not
hold is refused with `stock_format_not_in_environment`, which names the
environment: add the format with `edit_raw_material`, or name one it holds.

- **`get_raw_material`** reads how many items and formats the environment
  holds of those you can use, and how many new standard rows it has not
  decided on. With `list: items` or `list: formats` it also returns the rows,
  each with `in_environment`. Filter by `in_environment`, `family` (one
  shape), `material_group`, `dimension_standard`, `kind`, `scope` (`standard`
  or `own`), a search `q`, or `only_new`. An item is named by `item_key`
  and `designation`; `kg_per_m` is answered for your own items and is
  `null` for a standard item. `format_kinds_empty` names the kinds of
  format the environment holds none of. It is read-only and free.
- **`edit_raw_material`** changes the list in bulk:
  - `action: add` or `remove` takes `items` and/or `formats`: `ids`, or
    `all: true` with filters — one shape, one standard, one material group, a
    search, what you keep in stock, or with no filter everything.
  - `add` with `environment_ids` adds one selection to several environments
    in one write. `environment_ids` is for `add` only; every other action
    takes `environment_id` and is refused with it.
  - `action: copy` makes the environment hold what `source_environment_id`
    holds; `replace: true` also removes the rest.
  - `action: mark_reviewed` stops the new standard rows counting as new.

  It counts by default and writes only with `apply: true`. A write is
  all-or-none, dated today and idempotent: what is already so is not counted.
  Nothing is deleted, and a calculation made earlier keeps what it was costed
  with. It needs `setup:write`.

An environment keeps at least one format of every kind it calculates
with: removing the last sheet format, or replacing the list with one that
holds none, is refused and the answer names the environment — add another
format of the kind first. Where an environment holds no sheet or bar format
all the same, a part is calculated in the standard formats you have not
hidden. Removing a row and adding it back on the same day leaves the
environment as it was. When an addition gives the environment two items of
one shape, material and size (another standard or delivery condition), the
answer says how many: a calculation that cannot tell them apart applies the
item price of neither.

"In stock" (`stocked` on an item) is a fact about your shelf, not about an
environment: it prices nothing, and it works as a filter here.

The base price of several stock items at once is two tools of the
`environments` toolset, beside the other price writes:
`environments_set_environment_raw_material_prices` and
`environments_clear_environment_raw_material_prices`; both take `dry_run`
and answer `in_environment`, how many of the selected items the environment
holds — a price for an item it does not hold applies once the item is added.

| Tool | REST |
|---|---|
| `get_raw_material` | `GET /environments/{env_id}/raw-material`, `…/raw-material/items`, `…/raw-material/formats` |
| `edit_raw_material` | `POST /environments/{env_id}/raw-material/add`, `/remove`, `/copy`, `/reviewed` and `POST /raw-material/add` (several environments), each with `dry_run` |
| `environments_set_environment_raw_material_prices` | `POST /environments/{env_id}/raw-material/prices` |
| `environments_clear_environment_raw_material_prices` | `POST /environments/{env_id}/raw-material/prices/clear` |

An own stock item or stock format joins the environments its create names
(`attach_to_environment_ids` on `POST /stock-items` and `POST
/stock-formats`): every open environment when left out, none for `[]`.

#### Machine lists

A machine list (`kind: machines`, or `POST /import/machines`) carries the
whole machine sheet, not only name, class and rate. Every machine capability
is a column: name it after the field (`max_spindle_rpm`,
`max_tool_diameter_mm`, `tool_interface`, `axes_simultaneous`,
`axes_indexable`, `max_table_load_kg`, `tool_magazine_capacity`,
`rapid_traverse_m_per_min`, `max_bar_diameter_mm`, `turret_stations`,
`counter_spindle`, `bar_feeder`, …) or the way your list already does:

| Column | Also read as |
|---|---|
| `max_spindle_rpm` | `rpm`, `Drehzahl`, `max. Drehzahl`, `Spindeldrehzahl` |
| `max_tool_diameter_mm` | `Werkzeugdurchmesser`, `max. Werkzeug-Ø` |
| `tool_interface` | `Werkzeugaufnahme`, `Aufnahme`, `HSK/SK` |
| `max_bar_diameter_mm` | `Stangendurchlass`, `Stangen-Ø` |
| `turret_stations` | `Revolverplätze` |
| `counter_spindle` | `Gegenspindel` |
| `axes_simultaneous`, `axes_indexable` | `Simultanachsen`, `Achsen` |
| `max_table_load_kg` | `Tischlast` |
| `tool_magazine_capacity` | `Magazinplätze` |
| `rapid_traverse_m_per_min` | `Eilgang` |
| `vendor`, `model_no`, `qty` | `Hersteller`, `Modell`, `Anzahl` |

- **Headers:** a unit after the name is fine (`Drehzahl [1/min]`,
  `Tischlast kg`), and so is a title or a date above the header row. `Typ`
  is the machine class in a list without a class column, and the model in a
  list with one.
- **Values** are read as written: decimal commas; `60.000` in a
  whole-number column as sixty thousand; `ja`, `nein` or `x` for yes and
  no; a list such as `flood, mql` for coolant and workholding;
  `800 x 500 x 450` for the envelope in one cell; a JSON object for a
  structured value (`vdi_3258`). A `-` leaves a value unstated.
- **Errors:** a value the machine cannot take is an error on its row that
  names the column. The other rows still import.
- **Quantity:** `qty` is read and shown in the plan, and the row is still
  one machine. A price is per machine hour, so how many identical machines
  you run changes no price, and no machine count is stored. Put machines on
  rows of their own to give each its own rate.
- **Library instances:** `as_library_instance: true` on
  `POST /import/machines` and its preview creates each new machine as an
  instance of the platform's standard type for its class. The machine holds
  only the capabilities your columns state, as `capability_overrides`; the
  type supplies the rest. Each created row names its type in
  `library_entry_id`. Without it, and through `import_setup_data`, each
  machine is your own, with its class's full standard capabilities and your
  columns over them.

### Calibrating from your history

The `calibration` toolset lets an agent calibrate an environment to what your
parts really cost: past jobs with their part number, lot size and actual cost,
from an ERP export or a spreadsheet. A grant that names `calibration:write`
lists it. So does `X-MCP-Toolsets: calibration`.

**`import_history`** takes an import one step per call:

1. **Send the history** as `rows`, as `csv` text, or as `data_source_id` (a
   `.csv` or `.xlsx` upload, with `sheet`).
   - Columns are matched by name, German ERP headers included: `Artikelnummer`
     or `Material`, `Menge` or `Losgröße`, `Stückpreis` or `Gesamtpreis`,
     `Auftrag`, `Jahresmenge`.
   - The answer is the import and its cost disclosure: rows usable, part
     numbers not in your library, parts without a STEP file, and how many new
     calculations pricing would start.
   - Lines it could not read are named by the line your file shows.
   - **Nothing is spent.**
2. **Price it:** `import_id`, `apply=true` and `expected_calculations`, the
   count you confirm. It never starts more calculations than that.
   - If the import would now need more, nothing is priced and the answer
     names the new count.
   - `expected_calculations=0` skips pricing and calibrates on the rows
     already priced.
3. **Calibrate it:** once its calculations are done, call `import_id` and
   `apply=true` again.
   - It fits the environment: one calibration run against your plan's
     monthly limit.
   - The answer is the error on held-out rows before and after, and what
     the fit left out: `rows_not_fitted` counts the rows per cause, and
     `rows_left_out` names them.
   - A fit that is refused says why in `failure_code`, with its figures in
     `failure_params`: `calibration_actuals_out_of_band` (your costs are
     too far from the prices to be a calibration; correct the environment
     first), `calibration_no_process_bin` (no row is filed under a process
     a price reads; label each row `process:<discipline>` or leave the
     label out) or `no_comparable_prices` (no row has a price a fit can
     use, counted per cause).

The same history sent again returns the same import while it is under way
or still the calibration the environment applies. After a refusal, a change
to the environment, or a revert, it starts a new import.

With `import_id` and `apply=false`, it says which of these steps comes next.

**`get_calibration_status`** reads how well an environment prices your
actuals. It answers:
- whether the environment is calibrated, and `inherited_from` when the
  calibration is a parent environment's: a child with no calibration of its
  own prices on its nearest parent's, and calibrating the child replaces
  that for the child (nothing is multiplied onto the parent's). Learned
  time factors are inherited one by one; `time_factors_replaced` counts
  those the environment takes from itself while it prices on a parent's
  price correction, which was fitted with the parent's times;
- the latest run's error on held-out rows before and after, coverage, and
  drift alerts (the environment's own runs, also when its calibration is
  inherited);
- the latest runs, each with its accuracy, so you can compare them and
  revert one with `calibration_revert_environment_run`;
- with `import_id`, where that import stands.

Each tool is the MCP face of the REST routes, so an integration without an
agent does the same:

| Tool | REST |
|---|---|
| `import_history` | `POST /calibration/imports`; `GET /calibration/imports/{id}`; `POST /calibration/imports/{id}/price` with `expected_calculations`; `POST /calibration/imports/{id}/calibrate` |
| `get_calibration_status` | `GET /calibration/environments/{env_id}/status` and `…/runs` |

The fitted values themselves stay in the app.

## What you get back

The MCP surface is the **public** face of the platform, so responses carry the
**cost answer and the explanation a buyer needs to act** — never the engine
internals. Selection scoring, per-operation cycle-time math, raw extraction
output, calibration parameters, and the platform machine-cost model are
stripped from every response an agent receives. Design around the result, not
the derivation.

## Read-only mode

A deployment can run the MCP server in **read-only mode** (`MCP_READ_ONLY`):
the write tools disappear from `tools/list` entirely, leaving only the
read tools, including the read-only cost and nesting tools. Pair it with a read-only API key
for defence in depth when the agent only needs to *read and analyse*.

---

## Tool annotations

Each tool carries MCP annotations the agent uses to decide how to call
it:

- Every tool's annotations carry its `title`, `readOnlyHint` and
  `destructiveHint`, so a client never has to infer a default.
- `openWorldHint` is `false` — every tool acts on your own tenant data (a
  closed domain), not an open external world like web search.
- `readOnlyHint` is `true` on every read — the curated cost and nesting
  reads, every `GET`, and the searches that are `POST`s only because the query
  rides in the body — and `false` on every write. A read's `destructiveHint`
  is `false`.
- `idempotentHint` is `false` for `POST` / `PATCH`, `true` for `PUT` and
  `DELETE`.
- `destructiveHint` is set on every write and describes **what the operation
  does, not what the verb says**: `true` when it updates, overwrites, cancels
  or deletes existing state. That includes the writes that remove your
  configuration even though they are `POST`s: the four
  `/environments/{id}/…/restore` calls (`…/rates/restore` closes every rate row
  the environment states) and the three "hide this platform item" calls (a
  tool-catalogue article, a subcontractor preset, a standard stock format),
  and the three `DELETE`s that end such a hide. Of the curated writes,
  `create_nest_run`, `start_nest_run`, `cancel_nest_run` and
  `release_nest_run` are `true`, because a job nest takes the remnants it
  cuts from your stock and nothing puts one back, and a released one is
  never a simulation again, and so is `apply_adjustment`, because it overwrites your
  environment's factors. `get_upload_link` is `false`: it adds an upload
  link and changes nothing that exists.

A well-behaved agent confirms with the user before calling a
`destructiveHint` tool. The hint is a courtesy to that agent and never a
control: scopes and your own tenancy are enforced at the API, whatever a
client chooses to do with the annotation.

---

## Prompts

On top of the tools the server ships a small set of **prompts** — the task-oriented "verbs
that matter" — that walk an agent through a whole workflow using whatever tools
your token exposes. Call `prompts/list` to discover them:

| Prompt | What it does | Arguments |
|---|---|---|
| `cost_a_part` | Upload a CAD file and price it in one call, follow the calculation to a final status, report unit / total / setup cost. | `part_number`, `lot_size`, `environment` |
| `compare_calculations` | Read two calculations and explain the cost delta and its drivers. | `calculation_id_a`, `calculation_id_b` |
| `compare_environments` | Price each part in several costing environments at once and recommend the cheapest environment per part. | `part_numbers_or_ids`, `environment_names_or_ids` |
| `explain_cost` | Explain one calculation's cost in plain language — decomposition and drivers. | `calculation_id` |
| `find_cost_drivers` | Rank the top cost drivers for a calculation to target a redesign or re-quote. | `calculation_id`, `top_n` |

Prompts are guidance, not privilege. Each step names a [default tool](#default-tools)
— never a REST route or a tool from an optional toolset — so an agent can call
everything a prompt sends it to. A step that needs a scope your credential
lacks names a tool your agent is not shown, and the REST layer would refuse the
call all the same.

---

## Worked example — agent quotes a part

```
user: Quote this STEP file at lot size 50, on our production env.
      [attaches bracket.step]

agent: <calls upload_and_quote>
       cad_file_b64=<base64 of the STEP>, part_number="BRACKET-001",
       lot_size=50, costing_environment_id=<prod env id>

agent: ← { id: "9d…", status: "queued", eta_seconds: … }

agent: <polls get_calculation for 9d… until status=succeeded>
agent: <calls explain_cost for 9d…>

agent: Unit cost at lot size 50 is €12.84 (total €642.00, setup €52.50).
       The deep pocket on the back face is the largest cost driver.
```

The agent didn't write a line of REST glue.

## Worked example — agent compares environments

```
user: Which of our environments makes these 3 brackets cheapest?

agent: <calls check_quota>                       # a grid costs parts × envs
agent: <lists environments, resolves the 3 part revisions>
agent: <calls calculations_batch_calculate>   # needs X-MCP-Toolsets: calculations
       part_revision_ids=[…,…,…],
       costing_environment_ids=[<prod>, <staging>, <sub_a>]
agent: ← { batch_id: "b4…", requested: 9, enqueued: 9 }

agent: <polls compare_environments(batch_id="b4…") until complete>   # calculations

agent: Subcontractor A is cheapest for 2 of 3 parts; basket −9.8% vs
       production. BRACKET-002 stays cheaper in-house (+4.1% at Sub A).
```

One batch call instead of nine single quotes — and the matrix (wins,
deltas, basket totals) is computed server-side, so the agent reports
the same numbers the UI shows. Both tools are in the `calculations`
toolset. The `compare_environments` prompt walks the same job with the
default tools: `quote_part` with several environments per part, then
`compare_calculations`.

## Worked example — agent checks a regional quote after a market move

```
user: Labour went up in Germany. What does that do to quote 9d…, delivered
      to our Stuttgart site?

agent: <calls find_environments(region="DE")>   # needs X-MCP-Toolsets: regional
agent: ← one available environment prices in DE; current version 2026.09

agent: <calls get_region_drivers(region="DE")>
agent: ← labour.eur_per_h (skill:3), answered by DE, not stale

agent: <calls diff_environments(environment_id="c7…")>
agent: ← labour_rates[skilled].value +10.0 % between 2026.08 and 2026.09

agent: <calls preview_reprice(calculation_id="9d…", version_id="<2026.09 id>")>
agent: ← estimate: unit cost 10.00 → 10.25 (+2.5 %) at the ordered lot;
         labour is the only mover

agent: <calls get_landed_cost(calculation_id="9d…", destination_region="DE-BW")>
agent: ← landed 11.10 per part, ex-works 10.00; freight and packaging lines

agent: Labour in Germany moved +10 %; that adds about 2.5 % to the unit
       cost of 9d… (an estimate from its stored cost shares). Delivered to
       Stuttgart it lands at about 11.10 per part. Applying the new version
       and re-pricing is yours to do in the workspace.
```

The figures are illustrative. All five tools are in the `regional`
toolset, and every call is a free read: nothing is priced, saved or billed.
A person applies the update and re-prices in the workspace — following,
applying and re-pricing are not available to agents.

## Worked example — agent nests this week's orders

```
user: What does order 4711 cost if we nest it with the rest of this week's
      sheet-metal work?

agent: <calls create_nest_run(environment_id=<prod>, batch_id="c7…")>   # nesting
agent: ← plan: 38 lines, 1 420 copies in 4 materials and thicknesses;
         7 remnant pieces in stock it would cut from; 2 left out
         (not_sheet). Nothing was started.

agent: This takes up to 7 remnants out of stock. Shall I start it?
user:  Yes.

agent: <calls create_nest_run(…, apply=true)>   # → run "e2…", queued
agent: <polls get_nest_run("e2…") until solved; the result comes with it>

agent: Order 4711's material comes to €1 184.20 on the shared sheets.
       23 sheets in all; 3 remnants used, 5 new ones back in stock.

user:  Good, send it to the laser.

agent: <calls export_nest_layout(run_id="e2…", format="dxf", sheet="all")>
agent: <calls release_nest_run("e2…")>   # plan: ended (solved), releasable
agent: <calls release_nest_run("e2…", apply=true)>
agent: Released: the 3 remnants left stock, 5 rests went in, and the
       €212.40 it saves now counts toward the total saved by nesting.
```

The agent confirmed before the start because the plan said what it takes
from stock, and the annotation told it the call is destructive. It
released the job nest only once the user sent it to be cut: the release
books the stock and cannot be undone. To quote a
part at its share of the shared sheets, it creates a calculation with
`nest_item_id` set to the part's `line_id`.

---

## Rate limits & billing

Each tool call is the REST call it makes, so it draws from the same
per-minute budget and per-key ceiling ([Rate limits](./rate-limits.md));
starting a calculation draws nothing on Pro, Scale and Enterprise and one
request on Free. You're billed for the
underlying billable operation (a successful calculation), not per tool
call — read-only tools are free. A calculation that fails or is cancelled
is never billed. A multi-environment
batch is one tool call but bills one calculation per
(revision × environment) cell. An assembly bills one calculation per
different part in each environment, only for parts that come back with
a price. Repeated copies of one part count once. A catalogue part such
as a screw does not. If the assembly is larger than what is left, the
largest parts are priced and the assembly price stays unpublished until
the rest is priced. `check_quota` first tells you what is left. The
exact count is known once the file has been read.

Every call that starts a calculation is a new calculation, billed when it
succeeds — an identical earlier run does not answer it. To make a retry
safe, pass `idempotency_key` to `quote_part` or `upload_and_quote`: a
retry with the same key and the same arguments within 24 hours returns
the first answer and bills nothing more, and the same key with other
arguments is refused (`idempotency_conflict`). The key is 1 to 128
letters, digits, `.`, `_`, `:` or `-`; choose one per logical request
(for example `erp-quote-rfq-2026-05-9012`). It travels as the REST
`Idempotency-Key` header ([Idempotency](./idempotency.md)) — the only
header a tool argument can set.

---

## Transport authentication

The MCP transport reads the `Authorization: Bearer` header only (an API
key or an OAuth grant); there is no `X-API-Key` header path on the MCP
server — that header is REST-only. Sandbox keys (`ak_test_…`) work
against the sandbox environment.

---

## See also

- [Authentication](./authentication.md) — bearer auth, scopes.
- [API reference](./api/index.md) — the REST surface MCP wraps.
- [Pay per call](./pay-per-call.md) — the keyless MCP server agents pay per calculation.
- [Recipes → Quote a part](./recipes/quote-a-part.md) — end-to-end flow.
- [MCP spec](https://modelcontextprotocol.io) — the protocol itself.
