Skip to main content
Glama

Pay a quoted order

shop.order.pay

Pay a quote with x402 (X-Payment header on this /mcp call, exact total_usd to the merchant payout wallet). The payment is settled and its receipt awaited BEFORE anything is delivered: status paid carries order {order_id, state, tx_hash, fulfillment?}; payment_pending (receipt not seen within 30 s) carries order_id, poll shop.order.get; repeating the call without payment on a quote you already paid returns already_placed. Without a payment the result is an error carrying the 402 challenge (accepts[0].payTo/amount, extra.quote_id) and pay.mpp.url for MPP clients. Errors: 402 payment_amount_mismatch, 410 quote_expired (a new quote is attached), 429 test_sku_daily_cap, 422 pii_required (+ merchant_encryption_key), 409 merchant_key_rotated, 400 pii_plaintext_rejected.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
piiNoBuyer data the quote lists in requires_pii, ONE envelope per kind: {"<kind>": {kid, alg: "hpke-x25519-sha256-chacha20" | "sealed-box-x25519", ciphertext_b64}}, encrypted to merchant_encryption_key (AAD = quote_id, max 16 KB). Plaintext is refused with 400 pii_plaintext_rejected.
quote_idYes
buyer_companyNo
waive_withdrawalNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
orderNo
stateYes
statusYes
order_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / pii
      Added value: +{
      +  "description": "Buyer data the quote lists in requires_pii, ONE envelope per kind: {\"<kind>\": {kid, alg: \"hpke-x25519-sha256-chacha20\" | \"sealed-box-x25519\", ciphertext_b64}}, encrypted to merchant_encryption_key (AAD = quote_id, max 16 KB). Plaintext is refused with 400 pii_plaintext_rejected."
      +}
  2. Changed1 schema field changed
    • addedOutput schema / properties / order
      Added value: +{
      +  "additionalProperties": {},
      +  "type": "object"
      +}
  3. Added

TDQS

A4.4/5.0
Behavior5/5

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

Goes far beyond the annotations (readOnlyHint=false, destructiveHint=false, openWorldHint=false) by disclosing the settlement ordering (receipt awaited BEFORE delivery), the 30 s pending timeout, idempotency behavior, the 402 challenge shape, and an itemized error taxonomy with status codes. This is exactly the behavioral context an agent needs for a money-moving call.

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

Conciseness4/5

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

The core action and delivery guarantee are front-loaded, and the dense error enumeration is high-value rather than filler. It is long for a single sentence-chain, but nearly every clause carries a distinct behavioral or error fact.

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

Completeness5/5

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

With an output schema present, the description need not restate return shapes, yet it still summarizes each status outcome (paid/payment_pending/already_placed/error) so the agent can branch correctly. For a payment tool with rich error semantics, the coverage is complete.

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

Parameters2/5

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

Schema description coverage is only 25%, so the description must compensate, yet it says nothing about buyer_company or waive_withdrawal, and only indirectly touches pii via the 422/400 error codes rather than explaining its envelope requirement. quote_id's role is inferable from the flow, but half the parameters remain undocumented in both places.

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?

States a precise verb+resource ('Pay a quote with x402') and scopes the mechanism (X-Payment header, exact total_usd to the merchant payout wallet). It clearly differentiates itself from shop.order.get (polling), shop.order.quote, and shop.order.cancel, which appear as siblings.

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

Usage Guidelines5/5

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

Explicitly tells the agent when this is the right call and what to do in adjacent situations: poll shop.order.get on payment_pending, expect already_placed on a repeat call, and use pay.mpp.url for MPP clients. The when-and-alternative routing is fully spelled out rather than inferred.

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.