Skip to main content
Glama

Pay for an order

pay_order
DestructiveIdempotent

Pay for an unpaid order with a Stripe shared payment token (spt_…) the user approved, scoped to at least the order amount in USD. For an order created with recipients, this pays for the whole group at once (scope the token to batch.price). On success the order is paid and goes to print. Use only after the user approved the purchase.

Input Schema

NameRequiredDescriptionDefault
order_idYesOrder id from create_postcard or create_letter, ord_…
shared_payment_tokenYesStripe shared payment token, spt_…

Output Schema

NameRequiredDescriptionDefault
idYesOrder id, ord_…
batchNoPresent when the order was created with recipients: the whole group. The top-level fields describe the first recipient's order; use batch.price and batch.checkout_url for the total and payment.
priceYes
objectYes
ordersNoEvery order in the group, when created with recipients
statusYesawaiting_payment, paid, printing, mailed, cancelled or refunded
productYesProduct id, e.g. postcard_4x6 or letter_certified
discountYesFirst-order discount, already taken off price; null when none applies
trackingYesUSPS tracking, for Certified Mail once printed
certifiedYesnone, certified or certified_return_receipt
order_urlYesOrder status page
preview_urlYesExact print preview
checkout_urlYesWhere the user pays; null once paid or cancelled
product_nameYes
status_detailYesPlain-English status to show the user
preview_image_urlNoPNG picture of the piece (postcard front and back, or the letter's first page) to show the user

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / properties / preview_image_url
      Added value: +{
      +  "description": "PNG picture of the piece (postcard front and back, or the letter's first page) to show the user",
      +  "type": "string"
      +}
  2. Changed2 schema fields changed
    • addedOutput schema / properties / batch
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Present when the order was created with recipients: the whole group. The top-level fields describe the first recipient's order; use batch.price and batch.checkout_url for the total and payment.",
      +  "properties": {
      +    "checkout_url": {
      +      "description": "One payment link for every unpaid order in the group",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "count": {
      +      "description": "How many recipients (one order each)",
      +      "type": "number"
      +    },
      +    "discount": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": false,
      +          "properties": {
      +            "amount_cents": {
      +              "type": "number"
      +            },
      +            "display": {
      +              "type": "string"
      +            },
      +            "reason": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "amount_cents",
      +            "display",
      +            "reason"
      +          ],
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "id": {
      +      "type": "string"
      +    },
      +    "price": {
      +      "additionalProperties": false,
      +      "description": "Total for the whole group",
      +      "properties": {
      +        "amount_cents": {
      +          "type": "number"
      +        },
      +        "currency": {
      +          "type": "string"
      +        },
      +        "display": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "amount_cents",
      +        "currency",
      +        "display"
      +      ],
      +      "type": "object"
      +    },
      +    "url": {
      +      "description": "Group page listing every recipient",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "id",
      +    "count",
      +    "url",
      +    "checkout_url",
      +    "price",
      +    "discount"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / orders
      Added value: +{
      +  "description": "Every order in the group, when created with recipients",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "id": {
      +        "type": "string"
      +      },
      +      "order_url": {
      +        "type": "string"
      +      },
      +      "preview_url": {
      +        "type": "string"
      +      },
      +      "to": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "to",
      +      "order_url",
      +      "preview_url"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  3. Changed3 schema fields changed
    • addedOutput schema / properties / discount
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "amount_cents": {
      +          "type": "number"
      +        },
      +        "display": {
      +          "type": "string"
      +        },
      +        "reason": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "amount_cents",
      +        "display",
      +        "reason"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "First-order discount, already taken off price; null when none applies"
      +}
    • removedOutput schema / properties / first_postcard_free
      Removed value: -{
      -  "additionalProperties": false,
      -  "description": "Present when the first-postcard-free offer applies",
      -  "properties": {
      -    "applied": {
      -      "type": "boolean"
      -    },
      -    "eligible": {
      -      "type": "boolean"
      -    },
      -    "how": {
      -      "type": "string"
      -    }
      -  },
      -  "type": "object"
      -}
    • changedOutput schema / required
      Previous value: -[
      -  "id",
      -  "object",
      -  "product",
      -  "product_name",
      -  "certified",
      -  "status",
      -  "status_detail",
      -  "price",
      -  "checkout_url",
      -  "order_url",
      -  "preview_url",
      -  "tracking"
      -]New value: +[
      +  "id",
      +  "object",
      +  "product",
      +  "product_name",
      +  "certified",
      +  "status",
      +  "status_detail",
      +  "price",
      +  "checkout_url",
      +  "order_url",
      +  "preview_url",
      +  "tracking",
      +  "discount"
      +]
  4. Changed2 schema fields changed
    • addedInput schema / properties / order_id / description
      Added value: +"Order id from create_postcard or create_letter, ord_…"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "certified": {
      +      "description": "none, certified or certified_return_receipt",
      +      "type": "string"
      +    },
      +    "checkout_url": {
      +      "description": "Where the user pays; null once paid or cancelled",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "first_postcard_free": {
      +      "additionalProperties": false,
      +      "description": "Present when the first-postcard-free offer applies",
      +      "properties": {
      +        "applied": {
      +          "type": "boolean"
      +        },
      +        "eligible": {
      +          "type": "boolean"
      +        },
      +        "how": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "id": {
      +      "description": "Order id, ord_…",
      +      "type": "string"
      +    },
      +    "object": {
      +      "enum": [
      +        "postcard",
      +        "letter"
      +      ],
      +      "type": "string"
      +    },
      +    "order_url": {
      +      "description": "Order status page",
      +      "type": "string"
      +    },
      +    "preview_url": {
      +      "description": "Exact print preview",
      +      "type": "string"
      +    },
      +    "price": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "amount_cents": {
      +          "type": "number"
      +        },
      +        "currency": {
      +          "type": "string"
      +        },
      +        "display": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "amount_cents",
      +        "currency",
      +        "display"
      +      ],
      +      "type": "object"
      +    },
      +    "product": {
      +      "description": "Product id, e.g. postcard_4x6 or letter_certified",
      +      "type": "string"
      +    },
      +    "product_name": {
      +      "type": "string"
      +    },
      +    "status": {
      +      "description": "awaiting_payment, paid, printing, mailed, cancelled or refunded",
      +      "type": "string"
      +    },
      +    "status_detail": {
      +      "description": "Plain-English status to show the user",
      +      "type": "string"
      +    },
      +    "tracking": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": false,
      +          "properties": {
      +            "number": {
      +              "type": "string"
      +            },
      +            "url": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "number",
      +            "url"
      +          ],
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "USPS tracking, for Certified Mail once printed"
      +    }
      +  },
      +  "required": [
      +    "id",
      +    "object",
      +    "product",
      +    "product_name",
      +    "certified",
      +    "status",
      +    "status_detail",
      +    "price",
      +    "checkout_url",
      +    "order_url",
      +    "preview_url",
      +    "tracking"
      +  ],
      +  "type": "object"
      +}
  5. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true, idempotentHint=true, and openWorldHint=true, so the safety profile is covered. The description adds genuine context beyond them: the token must be scoped to at least the order amount in USD (batch.price for groups), and on success the order is paid and 'goes to print' – a side effect the annotations do not convey.

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 tight sentences, front-loaded with the core action and its required credential, followed by the group-payment edge case and the approval precondition. No filler.

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?

An output schema exists, so return values need not be described. The description covers the mutation's precondition, the credential scoping rules, the batch case, and the success side effect (order goes to print) – everything an agent needs to invoke it correctly.

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

Parameters4/5

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

With 100% schema coverage, both parameters are already documented, so the baseline is 3. The description adds real meaning beyond the schema: the token must be scoped to at least the order amount in USD and, for recipient orders, to batch.price – constraints that matter for correct invocation.

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 specific verb and resource ('Pay for an unpaid order') and immediately identifies the required payment artifact (Stripe shared payment token). An agent can distinguish this from create_postcard/create_letter (creates orders) and cancel_order without opening any schema.

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

Usage Guidelines4/5

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

Gives a clear precondition ('Use only after the user approved the purchase') and clarifies behavior for a specific case (orders created with recipients pay the whole group at once). It does not explicitly name sibling alternatives or when-not to use, but the context is unambiguous.

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.