Skip to main content
Glama

describe_rpc_command

Get structured help for Bitcoin RPC commands including descriptions, arguments, and usage examples to understand and implement blockchain operations.

Instructions

Get structured help for a Bitcoin RPC command: description, arguments, examples.

Args: command: RPC command name (e.g. "getblock", "sendrawtransaction")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `describe_rpc_command` tool is implemented as a function in `src/bitcoin_mcp/server.py`. It uses the `get_rpc().help(command)` method to retrieve help text, then parses the raw output into structured JSON containing the command signature, description, arguments, and examples.
    def describe_rpc_command(command: str) -> str:
        """Get structured help for a Bitcoin RPC command: description, arguments, examples.
    
        Args:
            command: RPC command name (e.g. "getblock", "sendrawtransaction")
        """
        try:
            help_text = get_rpc().help(command)
        except Exception as e:
            return json.dumps({"error": str(e)})
        lines = help_text.strip().split("\n")
        description_lines = []
        arguments = []
        examples = []
        section = "description"
        for line in lines[1:]:  # skip first line (command signature)
            if line.strip().lower().startswith("argument"):
                section = "arguments"
            elif line.strip().lower().startswith("example"):
                section = "examples"
            if section == "description":
                description_lines.append(line)
            elif section == "arguments":
                arguments.append(line)
            elif section == "examples":
                examples.append(line)
        return json.dumps({
            "command": command,
            "signature": lines[0] if lines else command,
            "description": "\n".join(description_lines).strip(),
            "arguments": "\n".join(arguments).strip(),
            "examples": "\n".join(examples).strip(),
        })

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Bortlesboat/bitcoin-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server