Skip to main content
Glama

Cancel purchase order

cancel_purchase_order
Destructive

Cancel a purchase order. Two-step confirm_token: the first call without confirm_token only returns confirmation_required, a summary, and confirm_token. That call does not write, delete, cancel, or send. The second call must repeat the same arguments plus that confirm_token; that is the write. A confirm boolean is ignored. The token expires in 5 minutes and works once.

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": {
      "order_id": "<order_id>"
    },
    "name": "cancel_purchase_order"
  }
}

Input Schema

NameRequiredDescriptionDefault
order_idYes
confirm_tokenNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Adds a great deal beyond the annotations: it discloses that the first call is a no-op dry run that writes/deletes/sends nothing, that the second call is the actual destructive write, that the token is single-use and expires in 5 minutes, and that a stray confirm boolean is ignored. These are exactly the non-obvious behaviors an agent needs to avoid an accidental partial or duplicate cancellation.

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?

The state-changing nature and the two-step flow are front-loaded, and every one of the five short sentences conveys a distinct operational fact (no-op first call, argument repetition, ignored boolean, expiry, single use). No filler.

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 destructive, non-idempotent, no-output-schema mutation, the description covers the confirmation handshake and partial return shape of the first call well. It stops short of saying whether cancellation is reversible, what the second call returns, or what errors occur on an expired/invalid token or an already-cancelled order.

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?

Schema coverage is 0%, so the description must carry meaning, and it fully specifies confirm_token (obtained from the first call, single-use, 5-minute lifetime, must accompany identical arguments) plus the pitfall of a confirm boolean. The remaining gap is order_id, which gets no explanation but is self-evident as an identifier.

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?

States a specific verb and resource ("Cancel a purchase order") immediately, so the operation is unambiguous. However, it never distinguishes itself from the sibling delete_purchase_order, which is a genuinely confusable alternative for an agent deciding how to remove an order.

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 unusually clear invocation context: call once to get a token, then repeat the same arguments with the token. It does not address when to prefer this over delete_purchase_order or how it relates to cancel_sales_order/cancel_return, so the alternative-selection guidance is absent.

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