Skip to main content
Glama

refund

Return captured money to the original payer, fully or by exact amount, fraction, or percentage of the captured total.

Instructions

Give captured money back to the original payer (it can only go back to the capture's payer). Full (omit amount), exact amount, or fraction/percent of the captured total computed for you (e.g. fraction 0.5 for 'half'). Retrying returns the same refund; a second refund of the same amount needs confirm_additional: true. Next: status shows refundable_remaining.

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": {
      "orderRef": "<orderRef>"
    },
    "name": "refund"
  }
}

Input Schema

NameRequiredDescriptionDefault
amountNoExact amount to refund. Give at most one of amount / fraction / percent; omit all three to refund everything not yet refunded.
reasonNoNote shown to the buyer.
percentNoRefund this percent of the captured total, computed by MCPal (e.g. 25 = a quarter).
fractionNoRefund this fraction of the captured total, computed by MCPal (e.g. 0.5 = half). Use this instead of doing arithmetic yourself.
orderRefYesYour merchant reference for this deal (e.g. 'invoice-1042'). Reuse it for every later call about the same deal.
confirm_additionalNoOnly true when the user explicitly wants ANOTHER refund of the same amount on this orderRef. Without it, repeating a refund returns the first one and moves no money.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that funds can only return to the capture's payer, that retrying is idempotent ('returns the same refund'), and that a repeat same-amount refund requires confirm_additional. It omits permissions/auth requirements and whether a refund can be reversed.

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?

Three dense sentences, front-loaded with the core action and constrained to behavior the schema does not cover (idempotency, confirm_additional, next step). The terse 'Next: status shows refundable_remaining' is slightly cryptic but earns its place as routing guidance.

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 6-parameter mutation tool with no annotations and no output schema, the description covers modes, payer constraint, retry semantics, and the follow-up status call. What it leaves out — failure behavior, permission requirements, and what the refund response contains beyond refundable_remaining — are modest gaps.

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 the schema already documents all six parameters including mutual exclusivity of amount/fraction/percent. The description's mode summary and 0.5 'half' example largely restate that, though 'omit all three to refund everything' adds a little framing.

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?

The description gives a specific verb+resource: 'Give captured money back to the original payer', and the parenthetical narrows the scope to captured funds only, which implicitly separates it from hold/void_hold siblings. It never names a sibling explicitly, so the differentiation is inferred rather than stated.

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?

It clearly enumerates the three invocation modes (full by omitting amount, exact amount, fraction/percent) and states the retry rule, plus points to 'status' as the next step for refundable_remaining. It does not say when NOT to use it (e.g. voiding an uncaptured hold), so exclusions are only implied.

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