Skip to main content
Glama

Cancel an unpaid order

cancel_order
DestructiveIdempotent

Cancel an order that has not been paid yet. Paid orders can be cancelled by emailing support before they are printed.

Input Schema

NameRequiredDescriptionDefault
order_idYesOrder id, ord_…

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, 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.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=true and readOnlyHint=false, so the safety profile is covered structurally. The description adds real behavioral context beyond that: the eligibility boundary (unpaid only) and the escalation route for paid orders. It does not spell out what state the order lands in after cancellation, which keeps it short of 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?

Two tight sentences with the primary constraint front-loaded and the fallback path second. No filler, no repetition of the title.

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?

An output schema exists, so return values need not be described. Between the annotations, the schema and these two sentences, an agent has what it needs to decide and invoke correctly; only the post-cancellation order state is unstated, which is minor.

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?

One parameter with 100% schema description coverage ('Order id, ord_…'), so the schema fully documents the input. The description adds no format, prefix or validation detail beyond that, making the baseline 3 appropriate.

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

Purpose4/5

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

Names a specific verb and resource ('Cancel an order') and adds a scope constraint ('that has not been paid yet'), which is more than a restatement of the title. It does not explicitly differentiate itself from the siblings, but none of them (create_letter, create_postcard, get_order, get_pricing, pay_order) overlap with cancellation, so ambiguity is low.

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?

States the condition for use (order must be unpaid) and gives an explicit alternative path for the excluded case (paid orders must go through support email before printing). It stops short of naming a sibling tool, but there is no sibling that performs this action.

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.