Skip to content
Spendkit
GuidesBuild with Spendkit
DEVELOPER REFERENCE · MCP TOOLS

MCP tool inputs and outputs

Spendkit exposes seven tools to an authenticated Agent connection. Each call is an MCP tools/call request: set params.name to the tool name and params.arguments to the input object below. To start with working code, copy a language example; to inspect the transport, see the HTTP request envelope.

One connection, one Agent identity.

The OAuth token identifies the Agent connection. Spendkit resolves its bound Payment Wallet and Policy on the server. Do not send policyId or a payment wallet address in tool arguments; unknown input fields are rejected. tools/list provides the current machine-readable input schemas.

Conventions for every tool

ToolRequired scopePurpose
spendkit_get_connectionAuthenticated connectionIdentify Agent, wallet, network, and readiness.
spendkit_get_policypolicy:readRead the bound onchain Policy.
spendkit_preview_paymentpayment:previewRead-only ALLOW or DENY for a proposed payment.
spendkit_authorize_paymentpayment:authorizeIssue one signed authorization and exact Router transaction.
spendkit_record_paymentpayment:recordAttach the wallet's submitted transaction hash.
spendkit_get_payment_statuspayment:readReconcile and read one payment intent.
spendkit_list_paymentspayment:readRead recent intents for this Agent.

spendkit_get_connection

Input: {}. Output: connection (Client ID and scopes), agent (Agent ID, bound wallet, readiness), network (network key, chain ID, RPC URL, Router address), authentication (token expiry), and paymentModel (which component sends transactions).

Input: {}
Selected output: {
  "connection": { "clientId": "<client-id>", "scopes": ["policy:read", "payment:preview"] },
  "agent": { "id": "<agent-id>", "paymentWallet": { "address": "0x..." }, "paymentReady": true },
  "network": { "key": "arbitrum-sepolia", "chainId": 421614, "rpcUrl": "https://...", "routerAddress": "0x..." },
  "paymentModel": { "serverBroadcastsPayment": false, "paymentWalletSubmitsTransaction": true }
}

Match agent.paymentWallet.address to the address controlled by your wallet signer. Authentication can succeed while paymentReady is false.

spendkit_get_policy

Input: {}. Output when ready: ready: true, Policy ID, owner and Agent identifiers, token, limits, daily spending, remaining daily amount, allowlist state, enabled/paused/revoked state, and _raw atomic amounts. Decimal limits are strings. Without a linked wallet, Policy, or ready Router, the output has ready: false and a reason.

Input: {}
Selected output: {
  "ready": true, "policyId": 42, "token": "USDG", "decimals": 6,
  "perTransactionLimit": "1", "dailyLimit": "10",
  "spentToday": "0.25", "remainingDaily": "9.75",
  "enabled": true, "emergencyPaused": false, "revoked": false,
  "recipientAllowlistEnabled": false
}

spendkit_preview_payment

ArgumentTypeMeaning
amountRequired stringPositive decimal token amount, for example "0.01".
recipientRequired stringNonzero EVM recipient address.
tokenOptional stringToken symbol, for example "USDG".

Output: allowed and reason. On ALLOW, also amount, amountAtomic, recipient, token, network, owner, policy, and wallet. On DENY, reason explains why; Policy or wallet detail may be present. Preview does not create an authorization or send funds.

Input: { "amount": "0.01", "recipient": "0x1111111111111111111111111111111111111111", "token": "USDG" }
Selected ALLOW output: { "allowed": true, "reason": "policy_allows_payment", "amount": "0.01", "amountAtomic": "10000", "token": "USDG" }
Selected DENY output: { "allowed": false, "reason": "per_transaction_limit_exceeded" }

spendkit_authorize_payment

ArgumentTypeMeaning
amountRequired stringPositive decimal amount for the payment.
recipientRequired stringNonzero EVM recipient address.
tokenOptional stringToken symbol; omit for the Agent default.
idempotencyKeyRequired string, 1–128 charactersStable identifier for one logical payment. Reuse only for the same details.

Output on ALLOW: intentId, status: "authorized", duplicate, authorization (authorization ID, Policy ID, Agent ID, Payment Wallet, token address, recipient, atomic amount, deadline), signature, and transaction (chainId, from, to, data, value). This response is permission to submit one specific Router transaction; it is not a completed payment.

Input: { "amount": "0.01", "recipient": "0x1111111111111111111111111111111111111111", "token": "USDG", "idempotencyKey": "order-123" }
Selected ALLOW output: {
  "allowed": true, "duplicate": false, "intentId": "<intent-id>", "status": "authorized",
  "authorization": { "paymentWallet": "0x...", "recipient": "0x...", "token": "0x...", "amount": "10000", "deadline": "..." },
  "signature": "0x...",
  "transaction": { "chainId": 421614, "from": "0x...", "to": "0x...", "data": "0x...", "value": "0x0" }
}
Selected DENY output: { "allowed": false, "reason": "policy_daily_limit_exceeded", "intentId": "<intent-id-or-null>" }

A repeated key may return duplicate: true and an existing intent state instead of a new transaction. Reusing it with changed details returns idempotency_key_conflict. Inspect the existing intent before any retry. Compare the authorized amount, recipient, wallet, chain, and Router with the intended payment before sending the exact returned transaction.

spendkit_record_payment

Input: intentId (required nonempty string) and txHash (required 32-byte 0x hash from the bound wallet's submitted transaction). Output: accepted, intentId, current status, and txHash. A rejected result has accepted: false and error. This call can reconcile a receipt immediately; it does not send a transaction.

Keep this call in the payment path: it links the transaction your wallet sent to its Spendkit intent for prompt tracking and Payment Activity updates. Without it, status may remain outdated until onchain reconciliation finds the transaction. The onchain Router still enforces spending limits. If this call fails after wallet submission, retry with the same intentId and txHash or check status; never submit a second transaction just to retry recording.

Input: { "intentId": "<intent-id>", "txHash": "0x<64-hex-characters>" }
Selected output: { "accepted": true, "intentId": "<intent-id>", "status": "submitted", "txHash": "0x..." }

spendkit_get_payment_status

Input: intentId (required nonempty string). Output: intentId, lower-case status, txHash or null, failureCode, failureMessage, recipient, atomic amount, token symbol, Policy ID, and timestamps. A missing or inaccessible intent returns {"status":"not_found"}. Querying status can trigger reconciliation.

Input: { "intentId": "<intent-id>" }
Selected output: { "intentId": "<intent-id>", "status": "confirmed", "txHash": "0x...", "failureCode": null, "amountAtomic": "10000", "token": "USDG" }

Lifecycle values include authorized, signing, submitted, confirmed, rejected, expired, reverted, and failed. Treat confirmed as successful payment; authorized and submitted are not final success.

spendkit_list_payments

Input: {} for the default 50 results, or {"limit":20} with an integer from 1 to 100. Output: rows for this authenticated Agent. Each row contains intentId, status, policyId, token, amountAtomic, recipient, txHash, failureCode, failureMessage, reconciliationState, createdAt, and updatedAt.

Input: { "limit": 20 }
Selected output: { "rows": [{ "intentId": "<intent-id>", "status": "confirmed", "token": "USDG", "amountAtomic": "10000", "txHash": "0x...", "reconciliationState": "settled" }] }
Implement the full sequence

Start with the HTTP/MCP quickstart, then follow the payment flow and error recovery guide. The live tools/list schema remains the authority for current input validation.