Skip to main content
Glama

cancel_order

DestructiveIdempotent

Request cancellation of an iFood order by submitting its order ID and a valid cancellation reason code obtained from get_cancellation_reasons.

Instructions

Request cancellation of an order using a code from get_cancellation_reasons. WARNING: request body is best-guess — verify against live iFood docs.

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>",
      "code": "<code>"
    },
    "name": "cancel_order"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesCancellation code obtained from get_cancellation_reasons for THIS order (e.g. '503'). No safe default exists — an invalid code yields CANCELLATION_REQUEST_FAILED.
order_idYesOrder ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already cover the safety profile (destructiveHint=true, idempotentHint=true, openWorldHint=true), so the bar is lower. The description adds genuinely new context the annotations cannot carry: the request body is a best-guess and should be verified against live iFood docs, which warns the agent the schema itself may be unreliable. It stops short of saying whether the cancellation is reversible or what the resulting order state will be.

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 short sentences, action first and the caveat second, visually flagged with WARNING. Every clause carries information; nothing is padding.

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, open-world write tool with no output schema, the definition covers the essential risk: the request body may not match the live API. What is missing is outcome context — whether the cancellation is pending confirmation, how failures surface beyond the error code, and whether retries are safe given idempotentHint.

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% and the schema already documents both parameters thoroughly, including the source of `code` and the CANCELLATION_REQUEST_FAILED consequence. The description only restates the code provenance, adding nothing about order_id or about the '503'-style format. Baseline 3 is correct since the schema does the heavy lifting.

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 ("Request cancellation of an order") and correctly frames it as a request rather than an immediate cancel, plus it points at the prerequisite tool. No competing sibling does the same thing, but the description never explicitly contrasts itself with confirm_order/dispatch_order, which is what a 5 would require.

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: the code must come from get_cancellation_reasons, and the schema reinforces it must be obtained for THIS order. It offers no when-not-to-use guidance (e.g. when an order can no longer be cancelled, or what to do after the request is rejected), so it is clear context without exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.