Developer workflows
Use a calculator API or MCP tool when an agent needs inspectable arithmetic
An agent can describe a calculation without being a reliable calculation engine. A bounded tool interface gives it an explicit contract and returns the formula and assumptions alongside the result.
Discover fields before asking for a result
The tool directory returns serializable metadata, input fields, defaults, and formulas. A request uses protocol uctool/1, a tool identifier, and an inputs object. All required inputs must be supplied. Unknown fields, nonfinite numbers, and unsupported choices produce errors rather than silently changing the calculation.
The response carries the engine version, normalized inputs, result, formula, and assumptions. These are useful provenance fields, but they do not prove the user selected the right business meaning or jurisdiction. Ask for clarification when the task is ambiguous.
Use the same deterministic engine through MCP
The stateless Streamable HTTP MCP endpoint offers calculator discovery and calculation tools. It uses the installed official SDK and negotiates the protocol versions that SDK supports. The tools do not modify accounts, save history, browse the web, or accept payments.
Body-size limits, origin checks, and per-address rate limits bound public access. A production API service also needs monitoring, edge abuse controls, capacity planning, and a measured service objective. Anonymous compute is not a paid API entitlement.
Keep generation and payment outside computation
A generated custom formula remains a proposal until its structure, dimensions, examples, and independent expected answers are checked. A JSON schema controls shape; it does not establish semantic correctness. The model provider adapter is unconfigured by default.
Agent billing through API subscriptions or x402 is a separate commercial integration. It requires real credentials, settlement verification, replay protection, and a durable accounting policy before it can be activated. A payment header alone must never grant access.
Primary references
Authored 2026-10-29. Worked examples checked against the shipped tools; no jurisdiction-specific tax advice is supplied. Examples use the assumptions stated here; authority guidance can change.