Skip to main content
Glama

Good Earth

Goodearth Restore Credits

goodearth_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. First observed

TDQS

A4.6/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses idempotency ('if the invoice is already credited... returns success with credits_granted=0') and the operator-only access restriction. It also clarifies the precondition: the invoice must be settled at BTCPay but uncredited on the ledger. It does not cover failure modes or full ledger side effects, but the key behavioral traits are present.

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 a bolded operator restriction, followed by a compact list of use cases and an idempotency note. Every sentence contributes operational information, with no filler or repetition.

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?

Given the presence of an output schema and fully documented parameters, the description provides sufficient context: when to use, who may use, and idempotent behavior. Minor gaps such as explicit failure handling or reversibility remain, but the core operational context is complete.

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% with detailed parameter descriptions, so the baseline is 3. The description adds meaning by tying invoice_id to the idempotent re-credit behavior and by reinforcing the operator restriction that aligns with dpop_token semantics. This goes slightly beyond the schema without duplicating it.

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 and resource: 'Credit a patron's ledger from a BTCPay-settled invoice.' The operator-only restriction and idempotency detail further distinguish it from sibling tools like goodearth_check_payment or goodearth_purchase_credits. It clearly identifies the tool's unique function.

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?

Explicitly restricts the tool to the operator and provides concrete use cases: cold-start vault races, ncred delivery hiccups, Top-Off sheets closing before settle, and infrastructure incidents. It also states who should not call it directly (patrons must escalate to support), giving clear when-to-use and when-not-to-use guidance.

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.