Skip to main content
Glama

Aitole — Kaspi Pay

Refund a paid operation (moves money)

refund
Destructive

MOVES MONEY, IRREVERSIBLE: return money to the customer for a paid operation, fully or partially. Always ask the user to confirm the operation id and amount before calling. Omit amount for a full refund of the remaining sum. Amounts are whole tenge (KZT) as integers: 5000 means 5,000 tenge, no tiyn/decimals. Refund window is 90 days; the key needs the "refund" scope. The operation stays "paid" and its refunded_amount grows. Check the returned refund status: Kaspi can refuse with HTTP 200 and status "failed". Pass idempotency_key (e.g. "refund-1024-1") so a retry does not refund twice. Use only for a paid operation; for an unpaid one use cancel_operation. Returns the refund with its status.

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": {
      "operation_id": "<operation_id>"
    },
    "name": "refund"
  }
}

Input Schema

NameRequiredDescriptionDefault
amountNoOptional partial refund amount; omit to refund the full remaining amount. Integer, whole tenge (KZT).
reasonNoOptional reason for the refund.
operation_idYesId of the paid operation to refund.
idempotency_keyNoOptional. Your own unique id for this request, e.g. the order number "order-1024". Repeating a call with the same idempotency_key returns the same result instead of creating a duplicate, so pass one whenever you might retry. If omitted, a random key is generated (then a retry WILL create a duplicate).

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 already declare destructiveHint=true, readOnlyHint=false and idempotentHint=false, yet the description still adds substantive behavior beyond them: the operation remains 'paid' with a growing refunded_amount, Kaspi can refuse with HTTP 200 plus status 'failed', and retries without an idempotency_key create duplicates. The idempotency guidance refines rather than contradicts the idempotentHint=false annotation.

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?

The most consequential facts are front-loaded in capitals ('MOVES MONEY, IRREVERSIBLE'), followed by the confirmation requirement, then the value/format details. Every sentence carries a distinct operational fact and there is no filler or restatement of the tool name.

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?

For a destructive money-moving tool with no output schema, the description covers eligibility, units, idempotency, the partial-vs-full rule, and the failure mode to check in the response. The only thin spot is the optional reason parameter, which is neither explained nor needed for correct invocation.

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 would be 3, but the description adds real semantics: amounts are whole tenge integers with a worked example ('5000 means 5,000 tenge, no tiyn/decimals'), and omitting amount means a full refund of the remaining sum, not a zero refund. It reinforces idempotency_key with a concrete example, though it does not discuss the optional reason field.

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?

The description opens with a specific verb+resource+effect: return money to the customer for a paid operation, fully or partially, and flags that it moves money irreversibly. It also distinguishes itself from the closest sibling by stating 'Use only for a paid operation; for an unpaid one use cancel_operation.'

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?

It gives explicit when-to-use (paid operation), when-not-to-use plus the alternative (unpaid -> cancel_operation), a required human-confirmation step before calling, and a hard eligibility constraint (90-day refund window, 'refund' scope on the key). No guidance is left implicit.

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.