Skip to main content
Glama

Diamond Bitcoin Intelligence

Decode a Lightning invoice

lightning_decode_invoice
Read-onlyIdempotent

Decode a Lightning BOLT11 invoice: amount, description, payee node, payment hash, creation and expiry time, whether it has expired, route hints. Paid per call. Price: 2 sats or US$0.002 (USDC) per call.

Input Schema

NameRequiredDescriptionDefault
l402NoOptional. After paying the Lightning invoice: '<token>:<preimage>'.
invoiceYesA Lightning BOLT11 invoice (lnbc...)
pay_withNoOptional. 'lightning' returns a BOLT11 invoice and a token instead of the x402 payment request.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, closed-world), so the description's real contribution is disclosing the paid-per-call model with concrete pricing (2 sats or US$0.002 USDC), which an agent cannot infer from the schema. It also discloses the returned fields in the absence of an output schema. It does not explain failure behavior for malformed or expired invoices, nor the L402 payment/retry loop, which is left to the schema.

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?

Front-loaded with the action and the returned fields, followed by a short pricing note; two sentences with no filler. The pricing sentence repeats 'per call' twice, a small redundancy that keeps it from a 5.

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?

With no output schema, the description correctly fills that gap by listing the decoded fields, and it surfaces the payment cost. Remaining gaps are minor: no note on how the l402/pay_with flow changes the response, and no error behavior for invalid invoices.

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%, covering invoice, pay_with, and the l402 token format, so the schema carries parameter meaning. The description adds nothing about the parameters themselves, so baseline 3 applies.

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 Lightning BOLT11 invoice') and enumerates exactly what is extracted: amount, description, payee node, payment hash, creation/expiry, expiry status, route hints. That distinguishes it from the many bitcoin_decode_* siblings, which decode transactions, scripts and PSBTs rather than invoices.

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

Usage Guidelines3/5

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

The enumerated output fields implicitly tell an agent when this is useful (inspecting an invoice before paying), but there is no explicit when-to-use, when-not-to-use, or named alternative. Nothing states prerequisites such as needing a valid lnbc-prefixed string or how this relates to the payment flow.

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.

Resources