Skip to main content
Glama

Refund payment

payments_refund
DestructiveIdempotent

Refund all or part of a captured payment across supported Indian gateways, using an idempotent refund reference to safely return money for full or partial order amounts.

Instructions

Refund all or part of a captured payment. refund_ref is the idempotency key: re-sending it after a success returns the same refund. If a call fails with OUTCOME_UNKNOWN, check payments_get_refund_status / payments_get_status BEFORE retrying. In live mode this moves real money: ask the human first, then pass confirm=true.

Input Schema

NameRequiredDescriptionDefault
speedNo
amountNoOmit for full refund
reasonNo
confirmNoRequired (true) in live mode, after human approval
providerYesGateway id
order_refYesMerchant reference: 3-40 chars, letters/digits/_/-
refund_refYesMerchant reference: 3-40 chars, letters/digits/_/-
include_rawNoInclude the untouched provider response (verbose).
provider_payment_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations declare destructive, idempotent and openWorld, so the safety bar is partly met by structured data; the description nonetheless adds the key semantics: refund_ref as idempotency key with replay-returns-same-refund behavior and the OUTCOME_UNKNOWN non-retry rule. It does not say what a partial refund does to subsequent refundable balance or whether instant speed carries extra cost.

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?

Four sentences, each with a distinct job: what it does, idempotency, failure recovery, money-movement safety. The safety-critical instruction is last-sentence prominent and nothing is padded.

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, open-world money-movement tool with 9 params and no output schema, it covers purpose, idempotency, uncertain-outcome recovery and approval gating. An agent has enough to invoke correctly and to avoid a duplicate refund.

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 67% and the description supplies the two most consequential semantics not fully in the schema: refund_ref is an idempotency key for safe resends and confirm=true is gated on human approval in live mode. It leaves speed, reason, include_raw and provider_payment_id unexplained, so it doesn't fully compensate for the remaining coverage gap.

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+scope: 'Refund all or part of a captured payment.' It also distinguishes itself from sibling retrieval tools by naming payments_get_refund_status and payments_get_status as recovery paths rather than refund paths.

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?

Explicit routing: on OUTCOME_UNKNOWN, check the two status tools BEFORE retrying, and in live mode ask the human first, then pass confirm=true. This gives when-to-use, when-not-to-retry, and the prerequisite gate in three compact sentences.

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