Skip to main content
Glama

crypto_bolt11_decode

Read-only

Lightning BOLT11 invoice decoder and validator — Decode and check a Bitcoin Lightning invoice before paying it (also accepts a lightning: URI or an L402/LSAT WWW-Authenticate header value that contains invoice=). Returns status VALID, EXPIRED or INVALID; network; amount in msat, sat and BTC (null for zero-amount invoices); description or description hash; payment hash and payment secret; payee node id (from the n field, or recovered from the secp256k1 signature); created and expiry times with seconds left; min final CLTV delta; route hints; fallback on-chain addresses; feature bits; plus the BOLT11 rule violations a compliant wallet must refuse (wrong field lengths, duplicate or missing p/s fields, missing description, unknown required feature bits, bad or high-S signature). Offline, passes the BOLT11 spec test vectors; no network calls. Returns 422 if the string is not a decodable invoice. Price: $0.003 USDC (Base, via x402).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "invoice": "<invoice>"
    },
    "name": "crypto_bolt11_decode"
  }
}

Input Schema

NameRequiredDescriptionDefault
invoiceYeslnbc2500u1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpu9qrsgquk0rl77nj30yxdy8j9vdx85fkpmdla2087ne0xh8nhedh8w27kyke0lp53ut353s06fv3qfegext0eh0ymjpf39tuven09sam30g4vgpfna3rh

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly/destructive/openWorld, and the description adds strong behavioral context: fully offline, no network calls, 422 on undecodable input, and a $0.003 x402 price. This is meaningful value beyond the annotations, though the offline claim sits in mild tension with openWorldHint=true (justified only by the payment flow).

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 core purpose before the exhaustive return-value list. The return enumeration is long and run-on, but most of it earns its place given there is no output schema; some tightening of the field list would help.

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 fully compensates by enumerating status, network, amounts, hashes, node id, times, CLTV, route hints, fallback addresses, feature bits, and rule violations. It also covers error behavior (422), so an agent has everything needed to call and interpret it.

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% and the single invoice param has an example, so the schema carries the baseline. The description adds real meaning by specifying accepted formats (lightning: URI and L402/LSAT header containing invoice=), which the schema does not convey.

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 ("Lightning BOLT11 invoice decoder and validator") plus the concrete task (decode and check an invoice before paying). It clearly distinguishes itself from sibling crypto_payment_uri and crypto_btc_payment_check by being specifically a BOLT11 decoder/validator.

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?

Provides clear usage context ("check a Bitcoin Lightning invoice before paying it") and notes it accepts alternative input forms (lightning: URI, L402/LSAT WWW-Authenticate header). It does not name alternative sibling tools or state when-not to use it, leaving some inference to the agent.

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