Skip to main content
Glama

Decode Lightning Invoice

decode_invoice

Decode a BOLT11 invoice to inspect its amount, description, expiry, and payment hash before Lightning payment.

Instructions

Decode a BOLT11 invoice to inspect its amount, description, expiry, and payment hash.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoiceYesBOLT11 Lightning invoice to decode

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden. 'Decode ... to inspect' strongly implies a pure read with no side effects, and it usefully discloses the returned fields (amount, description, expiry, payment hash), but it says nothing about error behavior on a malformed invoice or whether network/credentials are needed.

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?

One front-loaded sentence with the verb, resource, and result fields in a single clause; nothing is wasted and nothing important is buried.

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?

For a trivial one-parameter read tool with no annotations and no output schema, the description covers purpose and the key return values, which is most of what an agent needs. It omits failure modes and the fact that no side effects occur, but those gaps are minor at this complexity level.

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 coverage is 100% for the single 'invoice' parameter, so the schema already documents type and meaning. The description adds no format or validation details beyond what the schema provides, making the baseline of 3 appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (Decode) and resource (BOLT11 invoice) and enumerates the returned fields, so an agent can distinguish it from create_invoice/pay_invoice at a glance. It does not explicitly name a sibling or state that it is the read-only parse path, which keeps it just short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

There is no explicit when-to-use guidance, no mention of alternatives (e.g. decode before pay_invoice to verify amount), and no exclusions. The purpose 'inspect' only implies usage, and nothing tells the agent when this is preferable to just calling pay_invoice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.