Skip to main content
Glama

Prepare SAP x402 Payment

sap_x402_prepare_payment

Prepare an x402 payment context using SDK X402Registry.preparePayment. New production escrow funding should use Escrow V2 fields and nonce-aware flows. SAP MCP context: Payment and settlement flow. Estimate or fetch state before creating escrows or settling calls; write operations require an enabled signer mode and MCP policy approval.

SAP MCP execution guidance: Intent: SAP MCP tool workflow. Pricing: paid value-action; preview cost and transaction effects before user confirmation. Routing: paid hosted call; call sap_estimate_tool_cost first, then use sap_payments_call_paid_tool if the runtime cannot handle x402 natively. Signer boundary: hosted reads/builders never receive keypair bytes; value-moving results must be finalized locally when signing is required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nonceNoOptional escrow nonce as a decimal string. Defaults to 0.
depositNoInitial deposit as a decimal string. Amount in the escrow token smallest unit: lamports for SOL, micro-USDC for USDC, or base units for the configured SPL token.
maxCallsNoOptional maximum number of calls covered
expiresAtNoOptional expiry timestamp in unix seconds
tokenMintNoOptional SPL token mint; omit/null for SOL. Use EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v for mainnet USDC.
agentWalletNoAgent wallet public key (base58)
volumeCurveNoOptional array of { afterCalls, pricePerCall } pricing breakpoints
pricePerCallNoPrice per call as a decimal string. Amount in the escrow token smallest unit: lamports for SOL, micro-USDC for USDC, or base units for the configured SPL token.
tokenDecimalsNoOptional token decimals. Defaults to 6 for USDC/SPL flows when supplied by the SDK and 9 for native SOL.
networkIdentifierNoOptional x402 network identifier written into headers

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesMCP content blocks returned to the caller.
isErrorNoTrue when the tool result represents an application-level error.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"Prepare SAP x402 Payment input schema. Intent: SAP MCP tool workflow. Pricing: paid value-action; preview cost and transaction effects before user confirmation. Routing: paid hosted call; call sap_estimate_tool_cost first, then use sap_payments_call_paid_tool if the runtime cannot handle x402 natively. Signer boundary: hosted reads/builders never receive keypair bytes; value-moving results must be finalized locally when signing is required. Use exact field names from this schema; do not guess aliases or include private key material."
  2. Changed5 schema fields changed
    • changedInput schema / properties / deposit / description
      Previous value: -"Initial deposit amount as a decimal string"New value: +"Initial deposit as a decimal string. Amount in the escrow token smallest unit: lamports for SOL, micro-USDC for USDC, or base units for the configured SPL token."
    • addedInput schema / properties / nonce
      Added value: +{
      +  "description": "Optional escrow nonce as a decimal string. Defaults to 0.",
      +  "type": "string"
      +}
    • changedInput schema / properties / pricePerCall / description
      Previous value: -"Price per call as a decimal string"New value: +"Price per call as a decimal string. Amount in the escrow token smallest unit: lamports for SOL, micro-USDC for USDC, or base units for the configured SPL token."
    • changedInput schema / properties / tokenDecimals / description
      Previous value: -"Optional token decimals"New value: +"Optional token decimals. Defaults to 6 for USDC/SPL flows when supplied by the SDK and 9 for native SOL."
    • changedInput schema / properties / tokenMint / description
      Previous value: -"Optional SPL token mint; omit/null for SOL"New value: +"Optional SPL token mint; omit/null for SOL. Use EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v for mainnet USDC."
  3. First observed

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnlyHint=false, and the description adds that write operations require an enabled signer mode and MCP policy approval. This provides behavioral context beyond annotations, but the description does not fully disclose the on-chain effects or state changes of preparing a payment context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is verbose and includes generic boilerplate ('SAP MCP execution guidance') that is not unique to this tool. The essential information is mixed with repetitive phrases, making it less concise than optimal.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the 10 parameters and existence of output schema, the description provides basic workflow context (estimate cost, routing) but does not explain the return value or how this tool fits into the broader x402 payment lifecycle. It is adequate but leaves gaps about subsequent steps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description does not add parameter-specific details beyond what the schema already provides. It mentions Escrow V2 fields and nonce-aware flows, but this is not tied to individual parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the tool's purpose: 'Prepare an x402 payment context using SDK X402Registry.preparePayment.' It identifies the specific verb (prepare) and resource (x402 payment context), distinguishing it from sibling x402 tools like fetching or settling escrows.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description notes that 'New production escrow funding should use Escrow V2 fields and nonce-aware flows' and advises to estimate or fetch state before creating escrows. However, it does not explicitly compare with alternative tools (e.g., sap_x402_build_headers_from_escrow) or specify when not to use this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.