Skip to main content
Glama

Issue refund

issue_refund
DestructiveIdempotent

Issue a full or partial refund on a paid order with amount and reason validation, duplicate-payment protection via idempotency keys, and audit logging.

Instructions

Refund money on a paid order. Guardrails: amount must be > 0 and within the remaining refundable amount; unpaid, cancelled and fully-refunded orders are refused; a reason and an idempotency_key are required, and repeating a key replays the original refund instead of paying twice. When refunds reach the order total the order becomes 'refunded'. Every refund is written to the audit log.

Input Schema

NameRequiredDescriptionDefault
reasonYesWhy the refund is issued; stored in the audit log.
order_idYesNumeric order ID, e.g. 1042.
amount_centsYesRefund amount in integer cents (1050 = $10.50). Must be > 0 and <= the order's remaining refundable amount (get_order -> financials.refundable_cents).
idempotency_keyYesUnique key for THIS refund, e.g. 'refund-1042-late-delivery'. Retrying with the same key returns the original refund instead of paying twice. Use a new key only for a genuinely new refund.

Output Schema

NameRequiredDescriptionDefault
orderYes
refundYes
replayedYesTrue when this key was already used for the same refund: nothing new was refunded.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, and the description adds substantive behavioral context beyond that: amount limits, refusal cases, idempotency replay semantics, order state transition to 'refunded', and audit logging. This is rich transparency for a mutation tool.

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 description is dense but well-structured, front-loading the purpose before listing guardrails, idempotency behavior, and side effects. Every sentence carries useful information and none is wasted.

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, idempotent mutation with an output schema and full annotation coverage, the description supplies everything an agent needs: purpose, eligibility, refusal cases, idempotency behavior, and side effects. No important behavioral gap remains.

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 coverage is 100%, so all four parameters are already documented in the schema. The description reinforces the amount guardrail and idempotency-key behavior, but much of that is already present in the schema descriptions, so this is baseline rather than added semantic value.

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 ('Refund money on a paid order') and clearly scopes the operation to paid orders. An agent can distinguish this from sibling tools like get_order or update_order_status without opening the 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?

The description gives clear when-to-use conditions and explicit when-not cases: unpaid, cancelled, and fully-refunded orders are refused. It does not name sibling alternatives such as using get_order to check the remaining refundable amount, but the guardrails are otherwise strong.

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