Skip to main content
Glama

Confita

Refund a payment

refund_payment
DestructiveIdempotent

For shop owners: refund all or part of one payment on an order. Nothing is refunded by this call: it always returns needs_confirmation, and the refund happens only when the seller taps Confirm. A card payment goes back to the customer's card through the shop's card provider; money paid outside Confita is marked refunded and the seller gives it back herself. With several payments on the order, payment names one. Cancelling a whole order (decide_order) refunds its card payments itself.

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": "<order>",
      "revision": "<revision>",
      "request_id": "<request_id>"
    },
    "name": "refund_payment"
  }
}

Input Schema

NameRequiredDescriptionDefault
orderYesThe order by its number ("1042" or "#1042") or id (ord_...).
amountNoHow much to refund; left out, everything left on that payment. For example {"amount": "10.00", "currency": "USD"} for $10 back.
reasonNoA short reason, kept with the refund.
paymentNoThe payment's id (pay_...), needed only when the order has several payments with money left to refund.
revisionYesThe order's `revision` as last read; if the order changed since, nothing happens.
request_idYesUnique per call; the same id again returns the first result.

Output Schema

NameRequiredDescriptionDefault
nextNo
errorNo
orderNo
choicesNo
outcomeNo
paymentNo
timezoneNo
confirmationNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations mark this destructive and idempotent, but the description adds the crucial nuance that nothing is actually refunded until the seller confirms — the call always returns needs_confirmation. It also explains the two refund paths (card provider vs. off-platform money marked refunded for the seller to hand back), which the annotations cannot convey.

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?

Purpose is front-loaded, and each following sentence covers a distinct concern: confirmation gating, money routing, payment selection, and the alternative tool. Dense but no sentence 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 six-parameter mutation with an output schema, the description covers the confirmation gate, the divergence between card and off-platform refunds, payment disambiguation, and the alternative tool. Nothing an agent needs to decide or call correctly is missing.

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 the baseline is 3, but the description adds the meaningful default that omitting `amount` refunds everything left on that payment and clarifies when `payment` is needed. The `revision` and `request_id` semantics are left entirely to the schema.

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 a payment), the audience (shop owners), and the scope (all or part of ONE payment on an order). It also names the sibling scenario it is not: cancelling a whole order belongs to decide_order.

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?

Gives the condition for using this tool and routes the whole-order case explicitly to decide_order, which refunds card payments itself. It also notes the multi-payment case where the `payment` parameter disambiguates, so the agent knows when the default is insufficient.

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