Skip to main content
You will route an agent’s calls to a payment tool through the gateway, hold any payment above a limit for a person to approve, and check the record offline. About 20 minutes.
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_payment with the arguments amount, currency and beneficiary.
  • 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.
The page then shows Gateway endpoint: /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:
  1. A payment up to the limit to an approved beneficiary is allowed.
  2. A payment above the limit to an approved beneficiary is held for approval of that exact payment.
  3. A payment to any other beneficiary is denied.
  4. Anything else is denied, so a call no rule describes is never a surprise.
The tool’s 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

Use https://gateway.tracelane.dev/v1/mcp/payments as the server URL, with your MCP-scoped key as the bearer token:
The gateway passes 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 an Idempotency-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 gets 409, not the tool result:
If your workspace has Slack or email alerts set up, approvers are notified; the message names the tool, the server, the rule and the expiry, but not the arguments. An owner or admin opens Approvals. The queue lists pending requests; choose Approve or Deny, with an optional note. Approving needs a recent sign-in. If yours is too old the gateway refuses with 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 the Idempotency-Key outside the retried function so both attempts carry it.
If the decision is denied, expired or times out, the helper returns a short message saying the action was not performed and should not be retried. For LangGraph, see Approvals for held tool calls.

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:
Or verify a file you exported yourself: 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 the streamable_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.