Skip to main content
Glama

optionality_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

TDQS

A4.7/5.0
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses idempotency, the need for a dpop_token signed by the operator's nsec, and that patron proofs are rejected. However, it does not mention what happens on authentication failure or if there are rate limits, which would be helpful for a restricted tool.

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 well-structured with clear sections, bullet points for use cases, and bold for key terms. Every sentence adds value, and the information is front-loaded. No wasted words or redundant explanations.

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?

Given the tool has an output schema (mentioned in context), the description adequately covers return behavior (credits_granted=0 for already credited invoices). It addresses purpose, usage constraints, use cases, and idempotency. For a tool with 3 parameters and clear restrictions, this 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%, baseline 3. The description adds significant context for dpop_token (Nostr event kind, operator-only requirement, rejection of patron proofs), which goes beyond the schema. For invoice_id and patron_npub, the description adds little beyond the schema, but the overall parameter documentation is well-supported.

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 clearly states the tool's purpose: crediting a patron's ledger from a BTCPay-settled invoice. It uses a specific verb-resource pair, identifies the source (BTCPay invoice), and distinguishes itself from siblings like purchase_credits by emphasizing manual restoration for operator-only use.

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 states it is RESTRICTED to the operator and provides concrete use cases (cold-start vault races, delivery hiccups, etc.). It also tells when not to use (patrons must escalate to operator support), giving clear guidance on when to invoke this tool versus alternatives.

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.

TDQS

B3.1/5.0
Disambiguation2/5

There is substantial overlap and confusion between multiple sets of tools. For example, `optionality_get_operator_onboarding_status` and `optionality_get_patron_onboarding_status` serve different identities but have a similar purpose that could be confusing. More critically, there are generic-named tools like `optionality_receive_credentials` and `optionality_receive_npub_proof` that both drain a relay mailbox in a very similar way, distinguished primarily by the type of token they return. The presence of both `optionality_session_status` and `optionality_service_status` is a major point of ambiguity, as both seem to check the health and configuration of the operator.

Naming Consistency4/5

The naming convention is highly consistent, using a snake_case, verb_noun pattern (e.g., `list_journal`, `delete_journal`). The prefix `optionality_` is applied to all tools. The verb 'get' and 'list' are used predictably. Minor point deduction for a few outliers like `optionality_deal_scenario` and `optionality_judge_trade` which are domain-specific verbs that don't perfectly fit the CRUD pattern but are still clear in context.

Tool Count1/5

With 71 tools, this server is severely over-staffed. This indicates poor separation of concerns, likely bundling multiple distinct domains or services into a single surface. A tool count this high dramatically increases cognitive load and API surface area, making it difficult for an agent to find the correct tool.

Completeness3/5

The tool surface covers an enormous amount of functionality, including imaginative ownership-proof flows via Nostr DMs. However, the `check_balance`/`purchase_credits` flow appears incomplete without a `refund_credits` tool for operator support scenarios. While the server has a `restore_credits` tool, it requires authentication. Overall, the surface is individually creative but organizationally incoherent.