Approval holds for MCP tool calls are a Preview and are not available on every workspace. The switch is per workspace and off by default. The signed approval record is a Preview: we have not yet observed it with a real approval in production, and the helpers below do not read or verify it. See Approvals for held tool calls for the full behaviour.
What you need
- A workspace where you are an owner or admin.
- An MCP server reachable over HTTPS that exposes a payment tool. The examples use
release_paymentwith the argumentsamount,currencyandbeneficiary. - A Tracelane API key with the MCP scope (Settings → Keys → Agent keys). A key made before that scope existed does not have it.
Step 1 — Turn on action control
Sign in as an owner or admin and open Settings → Workspace. Under Action control (preview), tick Turn on action control and confirm. Only owners and admins can change it, and the change is recorded in the change log. It applies to this workspace only. It usually takes effect within 15 minutes, and the first agent call after a quiet period may still use the old setting. Until it is on, the policy and actions pages answer that action control is off.Step 2 — Register the MCP server
Open Agents & tools → MCP servers and choose Add server. Fill in:
The same call is
POST /v1/mcp-servers. It needs an owner or admin credential: a tenant API key cannot register a server.
/v1/mcp/payments. A workspace can register up to 20 servers.
Step 3 — Apply the Payments template
Open Rules, choose Start from a template, then Payments, and set:
Choose Publish policy and confirm. The policy has four rules, first match wins:
- A payment up to the limit to an approved beneficiary is allowed.
- A payment above the limit to an approved beneficiary is held for approval of that exact payment.
- A payment to any other beneficiary is denied.
- Anything else is denied, so a call no rule describes is never a surprise.
amount is read as a whole number in the unit you chose, and currency must be the code you chose (here USD); a call in any other currency is refused, not converted or guessed at.
Step 4 — Point the MCP client at the gateway
Usehttps://gateway.tracelane.dev/v1/mcp/payments as the server URL, with your MCP-scoped key as the bearer token:
initialize, tools/list, tools/call and the other standard MCP methods through. If your server needs a session, send initialize first and pass its mcp-session-id header on later calls, as any MCP client does.
Step 5 — Send an Idempotency-Key
A protected tool requires anIdempotency-Key header on every tools/call, as in Step 4. Without one the gateway answers 400 idempotency_key_required.
- It must be a UUID. Anything else, or a repeated header, is refused with
400 invalid_idempotency_key, and the answer names the header. - Make one per logical payment, not per attempt, and reuse it on the retry after approval with the same arguments. Once a call has run under a key, a different body under that key is refused as
idempotency_mismatch. - Send the header once. Repeated headers are refused.
Step 6 — See the hold, then approve
The call in Step 4 is 750000 cents, 7,500 dollars, above the 5,000 dollar limit. The gateway detects it and holds it. The agent gets409, not the tool result:
reauth_required: sign in again and retry. A tenant API key cannot approve.
Step 7 — Retry with the SDK helper
The helpers wait for the decision and retry the identical call once. They do not decide anything: a retry that has no approval is held again by the gateway. Create theIdempotency-Key outside the retried function so both attempts carry it.
Step 8 — Export and verify offline
Approval decisions on the default path are written to the workspace’s hash-chained ledger. Export a range that covers your test and replay it on your own machine with the open-source verifier. There is no pre-built binary yet, so build it from source:tracelane-audit verify --file ./audit-range.ndjson --tenant-pubkey <pubkey>. Get the public key from Evidence → Signing key or GET /v1/audit/pubkey, never from the export you are checking. Only exit code 0 is a pass; 3 means the chain is consistent but no public anchor covers it yet, which is normal for a new workspace. Details: Verifier CLI and Audit ledger.
Limits
Protected tools need thestreamable_http transport and an Idempotency-Key; one retry after approval, and only before the approval’s expires_at; the Payments template takes one currency per tool and never converts between currencies; 20 servers per workspace; holds and the signed approval record are a Preview.