Skip to main content
Glama

taxsort_restore_credits

Credit a patron's ledger from a BTCPay-settled invoice.

RESTRICTED to the operator — the operator owns the books and is the only party who can issue a manual credit grant. Patrons who believe they paid but never got credits must escalate to the operator's support, who then invokes this tool on their behalf.

Use cases: cold-start vault races during check_payment, ncred delivery hiccups, patrons closing Top-Off sheets before settle, any infrastructure incident that left an invoice settled at BTCPay but uncredited on the operator's ledger.

Idempotent — if the invoice is already credited (in the patron's credited_invoices), returns success with credits_granted=0.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dpop_tokenYesA kind-27235 Nostr event signed by the OPERATOR's nsec for this tool. Patron proofs are rejected.
invoice_idYesThe BTCPay invoice ID to verify and credit.
patron_npubYesThe patron's npub whose ledger receives the grant.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / dpop_token / description
      Added value: +"A kind-27235 Nostr event signed by the OPERATOR's nsec\nfor this tool. Patron proofs are rejected."
    • addedInput schema / properties / invoice_id / description
      Added value: +"The BTCPay invoice ID to verify and credit."
    • addedInput schema / properties / patron_npub / description
      Added value: +"The patron's npub whose ledger receives the grant."
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full disclosure burden. It does this well by revealing three important behaviors: the tool is restricted to the operator's signed dpop_token, it is idempotent, and if the invoice is already credited it returns success with credits_granted=0. This exceeds the bare schema and gives the agent dependable expectations about repeated or unauthorized calls.

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 description is front-loaded with the core action, then organizes the restriction, use cases, and idempotency into clearly separated paragraphs. Every sentence adds operational value, and the bullet-style use-case list is compact yet informative. No filler or redundancy is present.

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?

This is a sensitive mutation-like tool with an authorization restriction, an idempotency guarantee, and several nuanced trigger scenarios. The description fully covers who may call it, why it may be needed, and how it behaves on duplicate calls. Since an output schema exists, return-value details are already structured, so nothing essential is missing for an agent to invoke it correctly.

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 invoice_id, patron_npub, and dpop_token clearly. The description adds context about the operator-only auth requirement and idempotency, but it does not materially extend the per-parameter meaning. Baseline 3 is appropriate because the structured schema does the heavy lifting.

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 pair: 'Credit a patron's ledger from a BTCPay-settled invoice.' It clearly distinguishes this from the 90+ sibling tools by naming the exact recovery scenario and stating the operator-only restriction. The purpose is unambiguous and not just a restatement of the tool name.

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?

The description explicitly states when the tool is appropriate: cold-start vault races, ncred delivery hiccups, closed Top-Off sheets, and infrastructure incidents where a BTCPay invoice settled but the ledger was never credited. It also gives a firm when-not: only the operator may use it, while patrons must escalate to support. These conditions are specific enough for an agent to decide correctly.

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.