Skip to main content
Glama

ucp_preview_checkout

Preview a UCP checkout and move it to ready-for-payment. Call after destination and shipping are set, before ucp_complete_checkout. Use ONLY for a checkout created with ucp_create_checkout. Checkout guide: read the MCP resource trusteed://guides/checkout.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "checkout_id": "<checkout_id>"
    },
    "name": "ucp_preview_checkout"
  }
}

Input Schema

NameRequiredDescriptionDefault
metaNoUCP request metadata. meta['ucp-agent'].profile = URL of the platform profile; it must be an https URL without credentials (at most 2048 characters).
agent_keyNoSandbox credential from `create_sandbox_key`. Use this when your client cannot set an `Authorization: Bearer` header.
checkout_idYesUCP checkout session ID (valid UUID)
payment_mandateNoPayment mandate issued by the platform for this cart: the compact JWS you receive after the approval opened by `preview_checkout` is granted (its `exp` is Unix seconds and `aud` is this store's slug). Forward it as received; a mandate you write yourself is not accepted here. The approval is bound to your agent credential and does not verify that a person was present. Use this when your client cannot set an `X-Payment-Mandate` header.
xyz.trusteed.shopping.buyer_intentNoOptional. What the person asked for, as structured constraints with who said each one (user_stated or agent_inferred) and the substitution policy. Safe to send: where the store compares it with the cart, a purchase that differs can stop before anything is charged. It is the agent's account of the request, not proof of what the person said.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / xyz.trusteed.shopping.buyer_intent / description
      Previous value: -"Optional. What the person asked for, as structured constraints with who said each one (user_stated or agent_inferred) and the substitution policy. The store may compare it with the cart when it enables this; it never proves what the person said."New value: +"Optional. What the person asked for, as structured constraints with who said each one (user_stated or agent_inferred) and the substitution policy. Safe to send: where the store compares it with the cart, a purchase that differs can stop before anything is charged. It is the agent's account of the request, not proof of what the person said."
  2. Changed1 schema field changed
    • addedInput schema / properties / xyz.trusteed.shopping.buyer_intent
      Added value: +{
      +  "description": "Optional. What the person asked for, as structured constraints with who said each one (user_stated or agent_inferred) and the substitution policy. The store may compare it with the cart when it enables this; it never proves what the person said."
      +}
  3. Changed2 schema fields changed
    • changedInput schema / properties / payment_mandate / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "properties": {
      -      "aud": {
      -        "description": "This store's slug (the one in the URL you are calling) — not a domain.",
      -        "maxLength": 256,
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "currency": {
      -        "description": "Three-letter currency code; must match the cart's currency.",
      -        "maxLength": 3,
      -        "minLength": 3,
      -        "type": "string"
      -      },
      -      "exp": {
      -        "description": "Expiry as an INTEGER of Unix seconds, in the future — not an ISO 8601 date string.",
      -        "exclusiveMinimum": 0,
      -        "type": "integer"
      -      },
      -      "mandate_id": {
      -        "description": "Your identifier for this mandate.",
      -        "maxLength": 128,
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "max_amount_cents": {
      -        "description": "Spending limit the buyer gave you, as an integer in minor units (cents).",
      -        "exclusiveMinimum": 0,
      -        "type": "integer"
      -      },
      -      "sub": {
      -        "description": "The identity you authenticate as — it is compared against it. When the credential tool returns a `mandate_subject`, use that value.",
      -        "maxLength": 256,
      -        "minLength": 1,
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "mandate_id",
      -      "max_amount_cents",
      -      "currency",
      -      "exp",
      -      "sub",
      -      "aud"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": {},
      +    "type": "object"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / payment_mandate / description
      Previous value: -"Payment mandate with `mandate_id`, `max_amount_cents` (integer, minor units), `currency` (3 letters, must match the cart's), `exp` (expiry as an INTEGER of Unix seconds — not an ISO 8601 date string), `sub` (the identity you authenticate as — it is compared against it) and `aud` (the store slug this mandate is for, e.g. the slug in the URL you are calling — not a domain). It is a spending cap you declare to limit yourself: it authorises nothing and does not prove the buyer's consent. Use this when your client cannot set an `X-Payment-Mandate` header."New value: +"Payment mandate issued by the platform for this cart: the compact JWS you receive after the approval opened by `preview_checkout` is granted (its `exp` is Unix seconds and `aud` is this store's slug). Forward it as received; a mandate you write yourself is not accepted here. The approval is bound to your agent credential and does not verify that a person was present. Use this when your client cannot set an `X-Payment-Mandate` header."
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "$schema": "http://json-schema.org/draft-07/schema#",
      -  "additionalProperties": true,
      -  "properties": {
      -    "approval_id": {
      -      "type": "string"
      -    },
      -    "approval_status_url": {
      -      "type": "string"
      -    },
      -    "approval_url": {
      -      "type": "string"
      -    },
      -    "checkout_session_id": {
      -      "type": "string"
      -    },
      -    "currency": {
      -      "type": "string"
      -    },
      -    "discount_cents": {
      -      "type": "number"
      -    },
      -    "expires_at": {
      -      "type": "string"
      -    },
      -    "expires_in_seconds": {
      -      "description": "Whole seconds left on this checkout SESSION at response time (0 when already past). It is not a stock reservation and not a price guarantee.",
      -      "minimum": 0,
      -      "type": "integer"
      -    },
      -    "items": {
      -      "items": {
      -        "additionalProperties": true,
      -        "properties": {
      -          "line_price": {
      -            "type": "number"
      -          },
      -          "name": {
      -            "type": "string"
      -          },
      -          "quantity": {
      -            "type": "number"
      -          }
      -        },
      -        "required": [
      -          "name",
      -          "quantity",
      -          "line_price"
      -        ],
      -        "type": "object"
      -      },
      -      "type": "array"
      -    },
      -    "next_step": {
      -      "enum": [
      -        "ask_user_payment_method",
      -        "complete_ucp_checkout"
      -      ],
      -      "type": "string"
      -    },
      -    "next_step_message": {
      -      "type": "string"
      -    },
      -    "payment_options": {
      -      "items": {
      -        "additionalProperties": true,
      -        "properties": {
      -          "available": {
      -            "type": "boolean"
      -          },
      -          "charges_without_approval": {
      -            "const": true,
      -            "type": "boolean"
      -          },
      -          "funding_source": {
      -            "anyOf": [
      -              {
      -                "enum": [
      -                  "platform_test_card",
      -                  "platform_test_wallet",
      -                  "buyer_wallet"
      -                ],
      -                "type": "string"
      -              },
      -              {
      -                "type": "null"
      -              }
      -            ]
      -          },
      -          "id": {
      -            "enum": [
      -              "demo_card",
      -              "demo_wallet",
      -              "own_wallet",
      -              "merchant_card",
      -              "paypal",
      -              "kyapay"
      -            ],
      -            "type": "string"
      -          },
      -          "label": {
      -            "type": "string"
      -          },
      -          "rail": {
      -            "enum": [
      -              "stripe",
      -              "x402",
      -              "kyapay",
      -              "paypal"
      -            ],
      -            "type": "string"
      -          },
      -          "reason_unavailable": {
      -            "enum": [
      -              "coming_soon",
      -              "not_enabled",
      -              "currency_not_supported",
      -              "unsupported_on_this_tool"
      -            ],
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "id",
      -          "label",
      -          "rail",
      -          "funding_source",
      -          "available"
      -        ],
      -        "type": "object"
      -      },
      -      "type": "array"
      -    },
      -    "shipping_authoritative": {
      -      "type": "boolean"
      -    },
      -    "shipping_cents": {
      -      "type": "number"
      -    },
      -    "shipping_source": {
      -      "enum": [
      -        "platform",
      -        "merchant_policy",
      -        "estimated"
      -      ],
      -      "type": "string"
      -    },
      -    "shipping_title": {
      -      "type": "string"
      -    },
      -    "status": {
      -      "enum": [
      -        "READY_FOR_PAYMENT",
      -        "PENDING_APPROVAL"
      -      ],
      -      "type": "string"
      -    },
      -    "store_name": {
      -      "type": "string"
      -    },
      -    "subtotal_cents": {
      -      "type": "number"
      -    },
      -    "tax_cents": {
      -      "type": "number"
      -    },
      -    "tax_status": {
      -      "enum": [
      -        "included",
      -        "not_calculated"
      -      ],
      -      "type": "string"
      -    },
      -    "total_cents": {
      -      "type": "number"
      -    },
      -    "total_is_final": {
      -      "type": "boolean"
      -    },
      -    "total_note": {
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "checkout_session_id",
      -    "store_name",
      -    "items",
      -    "subtotal_cents",
      -    "shipping_cents",
      -    "discount_cents",
      -    "total_cents",
      -    "currency",
      -    "tax_cents",
      -    "tax_status",
      -    "total_is_final",
      -    "total_note",
      -    "status"
      -  ],
      -  "type": "object"
      -}New value: +null
  5. Changed2 schema fields changed
    • removedOutput schema / properties / next_step / const
      Removed value: -"complete_ucp_checkout"
    • addedOutput schema / properties / next_step / enum
      Added value: +[
      +  "ask_user_payment_method",
      +  "complete_ucp_checkout"
      +]
  6. Added

TDQS

A4.4/5.0
Behavior4/5

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

The annotations declare a non-read-only, non-destructive, non-idempotent, closed-world operation; the description adds the crucial behavioral fact that the call mutates state into a ready-for-payment stage that precedes completion. It stops short of describing failure modes, whether a prior preview is required, or how the payment mandate gates the transition, so it earns a 4 rather than a 5.

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

Conciseness5/5

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

Three short sentences, front-loaded with the action and state transition, then preconditions, then the exclusion and guide pointer. Nothing is redundant or wasted.

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

Completeness4/5

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

For a five-parameter mutation with a fully documented schema and no output schema, the description covers preconditions, sequencing, and scope restrictions adequately. It does not say what a successful preview returns (totals, validation warnings) even though no output schema exists, which is a modest gap.

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 every parameter including meta, agent_key, payment_mandate, and buyer_intent is already documented in the schema, which sets the baseline at 3. The description adds no parameter-level meaning (e.g., when checkout_id is invalid, or how payment_mandate interacts with this preview step) beyond what the schema already says.

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 gives a specific verb and resource plus the resulting state change: preview a UCP checkout and move it to ready-for-payment. It also distinguishes itself from ucp_complete_checkout, so an agent can tell the two apart without opening either schema.

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?

It states the precondition (destination and shipping are set), the ordering relative to ucp_complete_checkout, and an explicit exclusion: use ONLY for a checkout created with ucp_create_checkout. It also routes the agent to the checkout guide resource for further detail.

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.

Resources