Skip to main content
Glama

Invoices: Undo payment

invoice_undo_payment
Destructive

Undo a payment recorded by mistake: reverses the last payment the person recorded on this invoice through the chat or MCP (invoice_mark_paid) within the last 10 minutes — the paid amount and status go back (Sent if it had been sent, else Open) and any ledger entry is offset. Older payments, and payments recorded in the cabinet, are reversed in the cabinet. Runs propose→confirm. CONFIRMATION: this tool is PROPOSED, never performed directly. You get status='confirmation_required' with an action_id and a plan_token, and the write happens only after confirm_action.

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": {
      "invoice": "<invoice>"
    },
    "name": "invoice_undo_payment"
  }
}

Input Schema

NameRequiredDescriptionDefault
invoiceYesThe invoice's number as the person said it (INV-12, 12) or its id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only say destructive/not read-only; the description goes well beyond by disclosing the 10-minute eligibility window, the exact resulting state (amount and status revert to Sent or Open), the ledger offset, and the propose→confirm flow including status='confirmation_required', action_id and plan_token. These are precisely the behavioral facts an agent needs before invoking a destructive operation, and they are consistent with destructiveHint=true.

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?

The purpose is front-loaded and the eligibility limits follow immediately, which is the right ordering. There is mild redundancy between 'Runs propose→confirm' and the subsequent 'CONFIRMATION: this tool is PROPOSED, never performed directly' sentence, but the emphasis is defensible for a destructive tool.

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?

For a destructive, confirmation-gated single-parameter tool with no output schema, the description covers what is changed, the eligibility window, what is untouched, the exact return signal the agent must handle, and the tool that completes the write. Nothing needed to call it correctly and interpret the response is missing.

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?

The single invoice parameter is fully documented in the schema (number as spoken, e.g. INV-12 or 12, or the id), so the schema carries the semantic load. The description adds no syntax or format detail beyond what the schema already states; it only refers to 'this invoice'. Baseline 3 applies for a 1-param tool at 100% coverage.

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 (undo a payment on an invoice) and narrows the scope precisely: the last payment recorded via chat or MCP (invoice_mark_paid) within 10 minutes. The boundary against cabinet-side reversal is stated explicitly, so an agent can distinguish this from invoice_mark_paid or a generic update tool 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 Guidelines5/5

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

Gives an explicit when: a payment recorded by mistake. It also gives explicit when-not conditions (older payments, cabinet-recorded payments → reverse in the cabinet) and names the sibling that created the state being undone (invoice_mark_paid) plus the required follow-up tool (confirm_action).

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.

Resources