Skip to main content
Glama

Decode a BOLT11 Lightning invoice (dev tool)

bolt11_decode
Read-onlyIdempotent

Decode a PUBLIC BOLT11 Lightning invoice (lnbc…): bech32 (BIP173) + tagged fields + the payee pubkey RECOVERED from the signature. Returns network, currency, timestamp, recovered_payee, amount_msat/amount_raw, payment_hash, description(_hash), payment_secret, payee_pubkey, features, fallback, expiry, min_final_cltv_expiry, routing_hints, signature and recovery_id. Reads only the invoice string — holds no key, verifies no channel, pays nothing. Pure, offline computation (blocktools); nothing is fetched or stored. How to combine this with the other tools: swapchan_playbook (workflows: find-money, best-swap, rebalance, revoke-approvals, bridge-stuck, token-safety, recover-old-wallet).

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": "bolt11_decode"
  }
}

Input Schema

NameRequiredDescriptionDefault
invoiceYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: "holds no key, verifies no channel, pays nothing", "Pure, offline computation (blocktools); nothing is fetched or stored." That directly explains why readOnlyHint/openWorldHint=false hold and reassures the agent that no side effects or network calls occur.

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 purpose, then safety posture, then return fields — the ordering is sensible. The trailing swapchan_playbook sentence with a long workflow list is somewhat boilerplate and dilutes focus, though the return-field enumeration earns its space since there is no output schema.

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 enumerates the returned fields (network, recovered_payee, payment_hash, routing_hints, etc.), which is exactly what the agent needs to know the result is usable. Combined with the no-side-effect guarantees, nothing material is missing for a single-parameter decoder.

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 0%, but the description compensates by specifying the expected input form — an lnbc-prefixed public BOLT11 string, bech32/BIP173 encoded. It doesn't address the 8000-char cap or what happens on malformed input, so not a 5.

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?

Specific verb+resource: "Decode a PUBLIC BOLT11 Lightning invoice (lnbc…)" with the encoding (bech32/BIP173) and scope (public, not private) stated up front. No sibling tool overlaps this function, and an agent can tell immediately what it does.

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?

The "PUBLIC" emphasis and the note that it reads only the invoice string imply the correct context (inspecting an invoice before paying), and the pointer to swapchan_playbook names where workflow-level guidance lives. It stops short of explicit when-not-to-use routing to a named alternative, so it falls short of a 5.

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.