Skip to main content
Glama

Register a refund you paid

shop.merchant.refund

Register a refund (needs refunds:write). The refund is YOUR transaction: send USDC back to the payer's wallet on the order's rail, then pass its tx_hash. APIbase only reads the chain and verifies: the transaction is confirmed, pays the payer, value >= amount. Verified: the order goes REFUND_PENDING -> REFUNDED (the refunds reach the order total) or PARTIALLY_REFUNDED (send further refunds until the total); otherwise 422 refund_rejected with the reason and the order is unchanged. More than the order total is 400. The platform fee is not returned. A transaction settles one refund only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYes
tx_hashYes
order_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateYes
statusYes
order_idYes
refund_idYes
refunded_usdYes
order_total_usdYes
verified_amount_usdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only declare the safety profile (readOnly=false, destructive=false, idempotent=false); the description adds substantial context beyond them: chain verification rules (confirmed, pays payer, value >= amount), state transitions (REFUND_PENDING -> REFUNDED/PARTIALLY_REFUNDED), error semantics (422 refund_rejected, 400 over-total), and that the platform fee is not returned. 'readOnlyHint=false' is consistent because the tool mutates order state even though the API itself only reads the chain.

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?

Front-loads purpose and permission, then the mechanics, then outcomes and errors. Dense but every sentence carries information; slightly long but no 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?

An output schema exists, so return values need not be described. The description covers precondition (send USDC first), permission, verification logic, success/failure states, and error codes, leaving nothing an agent needs before calling it.

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 0%, so the description carries the burden for all three parameters. It clarifies tx_hash (the on-chain USDC refund transaction hash) and constrains amount (cannot exceed the order total), but says nothing about order_id's format or the amount's string/units representation.

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 (register a refund) and immediately names the required permission scope (refunds:write). It is clearly distinguishable from nearby siblings like shop.order.pay, shop.order.cancel, and shop.order.dispute without opening any 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?

Gives strong context on how and when to use it: you must first send USDC back to the payer on the order's rail and then submit the tx_hash. It also states the outcome conditions (full vs partial refund). It does not, however, name an alternative tool or an explicit 'when not to use this' case.

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.