Skip to main content
Glama

refund_invoice

Process refunds for BTCPay invoices with flexible calculation methods including rate-based, fiat amount, or overpayment options.

Instructions

Refund a BTCPay invoice.

Args: invoice_id: The invoice ID to refund. refund_variant: Refund calculation method. Options: 'RateThen' (use rate at time of invoice, default), 'CurrentRate', 'Fiat' (refund exact fiat amount), 'OverpaidAmount' (refund only overpayment). payout_method_id: Optional payout method ID for the refund destination. subtract_percentage: Percentage to subtract from refund (0-100). Default: 0.

Returns the refund result with pull payment ID and amount.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoice_idYes
refund_variantNoRateThen
payout_method_idNo
subtract_percentageNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations provided, so description carries full burden. Mentions return value contains 'pull payment ID' (hinting at side effect of creating a pull payment). However, lacks explicit disclosure of mutation nature, idempotency guarantees, or error scenarios. Adequate but not comprehensive for a financial operation.

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?

Well-structured with clear 'Args:' and 'Returns:' sections. Information density is high with minimal waste. Docstring-style formatting is slightly verbose but highly readable and appropriate for the complexity of refund_variant options.

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?

Given 4 parameters with 0% schema coverage and no annotations, the description successfully documents all inputs. Output schema exists, so brief mention of return value (pull payment ID and amount) is sufficient. Could improve by explicitly stating side effects (creates pull payment) and prerequisites.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, but description comprehensively documents all 4 parameters. refund_variant includes enum-like values with detailed explanations (RateThen, CurrentRate, etc.). payout_method_id clarifies it's for 'refund destination'. subtract_percentage includes valid range (0-100). Fully compensates for empty schema descriptions.

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?

Description opens with specific verb 'Refund' and clear resource 'BTCPay invoice'. Distinct from siblings like create_invoice or get_invoice. Immediately clear this is for processing refunds against existing invoices.

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?

Provides detailed guidance on refund_variant options (RateThen vs CurrentRate vs Fiat vs OverpaidAmount), explaining when to use each calculation method. Lacks explicit comparison to sibling tools like create_pull_payment, but the variant explanations serve as strong implicit usage guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ThomsenDrake/btcpay-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server