Skip to main content
Glama

Agent Data Tools: Chain data

Decode a Lightning invoice

ln_invoice

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.002/call via x402 USDC or a card key (/credits), first 25 free; failed calls free. Reads or computes only; not marked read-only because each call is charged.

Input Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations set readOnlyHint=false, which would otherwise puzzle an agent; the description resolves this directly ('Reads or computes only; not marked read-only because each call is charged'). It also adds pricing behavior ($0.002/call, first 25 free, failed calls free) not in the annotations, covering auth/cost concerns.

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?

Front-loaded with the core action and return fields, then usage, pricing, and the read-only caveat. Every sentence carries distinct information with no redundancy.

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?

No output schema exists, so the description enumerates the returned fields itself. Combined with usage, pricing, and safety semantics, an agent has everything needed to decide and to call it correctly.

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?

With schema coverage at 100% and only one parameter, the schema already documents the 'invoice' string and its lnbc format. The description reinforces that decoding does not trigger payment, but adds no format or syntax detail beyond the schema. Baseline 3 is appropriate.

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 ('Decode') and resource ('BOLT11 Lightning Network invoice'), then enumerates exactly what is extracted (network, amount in sats and BTC, payment hash, creation/expiry time, expired status). It is unambiguously the only Lightning tool among a sea of EVM/BTC siblings, so differentiation is clear.

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?

Explicitly states the purpose-driven trigger: 'Use to check what an invoice asks for before an agent pays it.' That is a clear when-to-use condition. It stops short of naming a sibling alternative, but no competing decode tool exists in the sibling list, so the guideline is adequate.

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.