Skip to main content
Glama

Diamond Bitcoin Intelligence

Decode a Bitcoin script

bitcoin_decode_script
Read-onlyIdempotent

Decode a Bitcoin script from hex (scriptPubKey, redeem or witness script): type, asm, descriptor, address, and the P2SH and P2WSH addresses that wrap it (Bitcoin Core decodescript). Paid per call. Price: 2 sats or US$0.002 (USDC) per call.

Input Schema

NameRequiredDescriptionDefault
l402NoOptional. After paying the Lightning invoice: '<token>:<preimage>'.
scriptYesA Bitcoin script as hex
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

A4.5/5.0
Behavior4/5

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

The annotations already establish read-only, idempotent, closed-world behavior. The description adds important non-annotation behavior: per-call pricing of 2 sats or US$0.002 USDC and an enumeration of returned fields, though payment retry mechanics are 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.

Conciseness5/5

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

Front-loads the action and returned fields in a dense but efficient first sentence, followed by short payment terms. There is no filler and the key usage information appears early.

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?

For a simple decoder with no output schema, the description adequately lists the returned fields and covers the key payment constraint. Annotations and full schema descriptions handle safety and parameter details, so nothing essential for correct invocation is missing.

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 description coverage is 100%, so the parameters are already documented. The description adds useful meaning for the script parameter by clarifying it can be a scriptPubKey, redeem script, or witness script, but it does not further explain l402 or pay_with beyond what the schema says.

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 Bitcoin script from hex, with enumerated outputs including type, asm, descriptor, address, and P2SH/P2WSH wrapping addresses. The script resource clearly separates it from sibling tools such as bitcoin_decode_transaction and bitcoin_decode_psbt.

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?

Gives clear usage context by specifying that the input is a hex-encoded scriptPubKey, redeem script, or witness script, and notes that calls are paid. It does not explicitly say when to choose this over bitcoin_decode_transaction or bitcoin_decode_psbt, nor when not to use it.

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