Skip to main content
Glama

Refund transaction

refund_transaction

Refund settled Midtrans transactions by order_id, with optional amount and reason; omit amount for a full refund.

Instructions

Refund a settled Midtrans transaction by order_id. Omit amount for a full refund. This moves real money back to the customer — use deliberately.

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": {
      "order_id": "<order_id>"
    },
    "name": "refund_transaction"
  }
}

Input Schema

NameRequiredDescriptionDefault
amountNoRefund amount in IDR. Omit for a full refund.
reasonNoOptional refund reason.
order_idYesThe order_id to refund.
refund_keyNoOptional idempotency key so a retried refund is not applied twice.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description must carry the behavioral load; it does disclose that this moves real money and implies the action should be considered irreversible. It does not cover required permissions, what happens if the transaction is already refunded or partially refunded, failure modes (e.g. insufficient balance), or expected response timing.

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?

Two short sentences, front-loaded with the verb and resource, then the parameter default, then the risk warning. Nothing is padded and each clause carries information.

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 money-moving mutation with zero annotations and no output schema, the definition covers the essential 'what' and a safety tone but leaves return values, refund result states, and error conditions unexplained. Adequate to call, not adequate to predict outcomes.

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 order_id, amount, reason and refund_key are already documented, including idempotency semantics for refund_key. The description's only added param meaning is the full-refund default, which restates the schema's amount description verbatim.

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?

States a specific verb and resource ('Refund a settled Midtrans transaction by order_id'), and the qualifier 'settled' implicitly separates it from cancel_transaction on unsettled payments. It never names a sibling explicitly, so differentiation is inferred rather than stated.

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 a concrete decision rule for the main parameter split ('Omit amount for a full refund') and a clear caution ('use deliberately') with the reason (real money movement). What's missing is explicit routing against alternatives such as cancel_transaction or get_transaction_status before refunding.

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