Skip to main content
Glama

tollbooth-authority

authority_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.3/5.0
Behavior4/5

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

With no annotations provided, the description carries the full behavioral burden. It discloses operator-only access, the manual credit nature, and idempotency by stating that already-credited invoices return success with credits_granted=0. It could additionally describe failure behavior for unsettled or invalid invoices, but the core traits are well covered.

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 structured with a one-line purpose, a bolded restriction, a crisp use-case list, and an idempotency note. Every section earns its place and no content is redundant with the schema.

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 restricted mutation tool with an output schema, the description provides the necessary access rules, trigger scenarios, and idempotent behavior. An agent can correctly decide to invoke this tool and understand the expected success semantics.

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 all three parameters. The description reinforces the operator-only requirement for dpop_token and adds the 'verify' nuance for invoice_id, but it does not substantially extend the schema's meaning.

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?

Description opens with a specific verb and resource: 'Credit a patron's ledger from a BTCPay-settled invoice.' It clearly identifies a manual credit-grant operation distinct from sibling tools like authority_purchase_credits or authority_certify_credits, and the use cases further anchor its purpose.

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?

The description explicitly restricts invocation to the operator and gives concrete use cases such as cold-start vault races and infrastructure incidents. It does not name alternative sibling tools or state when not to use it, but the context is clear enough for an agent to route appropriately.

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.