Skip to main content
Glama

Decode a Lightning invoice: decode a BOLT11 Lightning invoice: amount, description, expiry and payment hash

ln_invoice
Read-only

Decode a BOLT11 Lightning Network invoice without paying it: network, amount in sats and BTC, description, payment hash, creation time, expiry time and whether it has already expired. Use to check what an invoice asks for before an agent pays it. Price $0.01/call via x402 USDC or a card key (/credits), first 25 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

Input Schema

NameRequiredDescriptionDefault
invoiceYesBOLT11 invoice string starting with ln (lnbc... for mainnet)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnly, non-destructive and non-idempotent, but the description adds real value beyond them: it explains why repeats are not free ('each call is charged'), discloses the price model ($0.01/call via x402 USDC or card key, first 25 free, failed calls free), and confirms the operation 'reads or computes only and changes nothing'. That is exactly the kind of billing and side-effect disclosure annotations cannot carry.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The decode scope and the 'without paying' caveat are front-loaded, which is the right ordering. There is slight redundancy in restating the charging model twice ('Price $0.01/call...' and 'each call is charged, so repeats are not free'), but both sentences otherwise earn their place.

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?

With no output schema, the description compensates by enumerating what comes back — network, amount in sats and BTC, description, payment hash, creation/expiry times and expired status. Combined with the payment model disclosure, an agent has everything needed to decide to call and interpret the result.

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% and the single 'invoice' parameter is already documented as a BOLT11 string starting with 'ln'. The description's list of decoded fields is return-value information rather than parameter guidance, so it adds nothing to the one argument beyond the schema — baseline 3.

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 ('Decode a BOLT11 Lightning Network invoice') plus the crucial scope qualifier 'without paying it'. No sibling tool in the list touches Lightning, so the tool is unambiguous against the EVM/BTC cluster it sits in.

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?

'Use to check what an invoice asks for before an agent pays it' gives a clear triggering context and even implies the decision it supports. No alternatives or exclusions are named, but there is no competing sibling to route away from, so the gap is minor.

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.