Skip to main content
Glama

Request a refund or open a dispute

request_refund
Destructive

Ask for a refund, or open a dispute, on an order. Use it when an eSIM went unused or plans changed (voluntary refund), or when it was not delivered, does not work or was bought twice (dispute). Example: {order_id: "ord_...", reason: "not_working", details: "QR installs, no data after restart, iPhone 15 on iOS 17"}. Returns the decision {allowed, reason_code, human_readable} and, when credited, the refund to the wallet. Reasons "unused" and "changed_plans" are voluntary refunds under the refund policy. Reasons "not_delivered", "not_working" and "duplicate_purchase" open a dispute under the dispute policy, which can refund fully, partially, reject, or escalate to a human. A dispute about a delivered eSIM is credited automatically only when the supplier confirms it cancelled the eSIM; otherwise, and for partial refunds, it is escalated (outcome "escalate", reason DISPUTE_SUPPLIER_CANCEL_UNCONFIRMED). Orders the supplier has not confirmed yet are refused with ORDER_AWAITING_SUPPLIER (poll order_status). An order takes one escalated dispute at a time (DISPUTE_ALREADY_OPEN until a human decides it) and a limited number of disputes in all (DISPUTE_LIMIT_REACHED). Any agent of the principal that owns the order may ask. ORDER_CHANGED is retryable. After a full refund, order_status no longer returns the activation code. Denials return error.code = the policy reason_code.

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>",
      "reason": "<reason>"
    },
    "name": "request_refund"
  }
}

Input Schema

NameRequiredDescriptionDefault
reasonYesunused or changed_plans (voluntary refund); not_delivered, not_working or duplicate_purchase (dispute)
detailsNoEvidence, up to 1000 characters: what you tried, error messages, the device. It helps a dispute succeed
agent_idNoYour agent id (or X-Agent-Id header)
order_idYesOrder id from purchase (order.order_id) or from an earlier order_status call
agent_keyNoSecret returned by register_agent (or X-Agent-Key header)
principal_idNoThe principal you act for (or X-Principal-Id header)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / details / description
      Added value: +"Evidence, up to 1000 characters: what you tried, error messages, the device. It helps a dispute succeed"
    • addedInput schema / properties / order_id / description
      Added value: +"Order id from purchase (order.order_id) or from an earlier order_status call"
    • addedInput schema / properties / reason / description
      Added value: +"unused or changed_plans (voluntary refund); not_delivered, not_working or duplicate_purchase (dispute)"
  2. Changed4 schema fields changed
    • addedInput schema / properties / agent_id / pattern
      Added value: +"^[A-Za-z0-9._:-]{3,128}$"
    • addedInput schema / properties / agent_key / maxLength
      Added value: +256
    • addedInput schema / properties / order_id / maxLength
      Added value: +128
    • addedInput schema / properties / principal_id / pattern
      Added value: +"^[A-Za-z0-9._:@-]{3,128}$"
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

With annotations only flagging destructiveHint/idempotentHint, the description carries the rest: auto-credit vs escalation rules, one open escalated dispute per order, a lifetime dispute cap, ORDER_CHANGED being retryable, and that a full refund hides the activation code from order_status. Authorization scope ('any agent of the principal that owns the order') is also disclosed.

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

Conciseness4/5

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

Dense but front-loaded: purpose, then use cases, then example, then return shape, then edge cases. A few sentences are long and stack multiple rules (the dispute auto-credit sentence), which slightly hurts scanability but nothing is 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?

For a destructive, non-idempotent mutation with no output schema, the description still names the return shape {allowed, reason_code, human_readable}, the wallet credit side effect, and every denial code an agent will encounter, leaving no material gap before calling it.

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 100%, so baseline is 3; the description goes further by tying each reason value to the governing policy and its refund outcome, and the inline example shows realistic values for order_id, reason and details ('QR installs, no data after restart, iPhone 15 on iOS 17').

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+resource ('Ask for a refund, or open a dispute, on an order') and immediately splits the tool's two modes by reason value, so an agent can tell it apart from siblings like purchase, order_status or troubleshoot without opening a 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?

Explicitly maps situations to reasons ('eSIM went unused or plans changed' -> voluntary refund; 'not delivered, does not work or bought twice' -> dispute) and names the alternative for the blocked case ('Orders the supplier has not confirmed yet are refused with ORDER_AWAITING_SUPPLIER (poll order_status)').

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.