Skip to main content
Glama
Zenskar MCP Server

Zenskar MCP Server

Official
by zenskar

refundPayment

refundPayment

Refund a payment in full or partially, sending funds to the original payment method or customer credits, while optionally writing off linked invoices.

Instructions

Refund a payment (full or partial). Pass refund_amount=0 (or full original amount) for a full refund, or a smaller positive integer for a partial refund. refund_destination + writeoff_invoices control where the refund money goes and whether linked invoices are written off. Host enforces user confirmation via the approval gate; do NOT ask the user to re-confirm before calling.

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": {
      "paymentId": "<paymentId>",
      "refund_amount": "<refund_amount>",
      "refund_destination": "<refund_destination>",
      "writeoff_invoices": "<writeoff_invoices>"
    },
    "name": "refundPayment"
  }
}

Input Schema

NameRequiredDescriptionDefault
paymentIdYesThe unique identifier (UUID) of the payment to refund.
__userContextNoInternal user context for multi-tenant authentication and approval workflow
refund_amountYesRefund amount in cents. Use 0 to refund the full payment, or a positive integer for a partial refund. Must not exceed the payment's remaining refundable amount.
writeoff_invoicesYesIf true, the invoice(s) linked to this payment are marked written off (no further collection). Set false to leave invoice balance owing after refund.
refund_destinationYesWhere to send the refund. Valid values: 'original_payment_method' (refund back to the source card/bank), 'credits' (issue customer credits instead of returning money).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.4.2
    • changedInput schema / properties / refund_amount / description
      Previous value: -"Refund amount in the smallest currency unit (integer cents/paise). Use 0 to refund the full payment, or a positive integer for a partial refund. Must not exceed the payment's remaining refundable amount."New value: +"Refund amount in cents. Use 0 to refund the full payment, or a positive integer for a partial refund. Must not exceed the payment's remaining refundable amount."
  2. First observedv2.2.4

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does add genuine behavioral information beyond the schema: the host's approval gate runs user confirmation and the agent must not re-confirm. However, it says nothing about irreversibility, who is authorized to refund, idempotency, or what happens when the amount exceeds the refundable balance.

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?

Four compact sentences, front-loaded with the operation and its two modes, then parameter control, then the approval-gate instruction. The approval-gate sentence is the one genuinely non-redundant addition; the rest overlaps the schema but is short enough not to feel wasteful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive financial mutation with no annotations and no output schema, the definition covers approval flow and parameter meaning but not the authorization model, failure conditions, or even a hint at what the call returns (refund record, status, id). That is a meaningful gap for a money-moving tool.

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 description coverage is 100%, so the schema already documents paymentId, refund_amount, refund_destination and writeoff_invoices precisely. The description restates the refund_amount convention and the destination/write-off coupling without adding format or constraint detail the schema lacks; baseline 3 applies.

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 very first words of the description state a specific verb and resource ('Refund a payment') and immediately distinguish two modes ('full or partial'). An agent can tell this apart from mutation siblings like editManualPayment or deleteManualPayment, though the description never names an alternative to explicitly contrast against.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear in-tool guidance on choosing between the full-refund and partial-refund paths, and on how the refund_destination choice changes the outcome. What is missing is any routing guidance versus siblings — nothing says when to prefer this over a credit note, invoice write-off, or manual payment edit.

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

Deploy Server

Other Tools