Skip to main content
Glama

get_indexed_transaction

Retrieve enriched Bitcoin transaction details with resolved addresses, spent/unspent status, and block context from blockchain indexers.

Instructions

Get enriched transaction details from the blockchain indexer.

Unlike analyze_transaction (which uses raw RPC), this returns resolved input addresses, spent/unspent status for each output, and block context. Falls back to mempool.space when the indexer is unavailable.

Args: txid: Transaction ID (64-character hex string)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
txidYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function `get_indexed_transaction` that fetches enriched transaction details using an indexed API with a fallback to mempool.space.
    def get_indexed_transaction(txid: str) -> str:
        """Get enriched transaction details from the blockchain indexer.
    
        Unlike analyze_transaction (which uses raw RPC), this returns resolved input addresses,
        spent/unspent status for each output, and block context.
        Falls back to mempool.space when the indexer is unavailable.
    
        Args:
            txid: Transaction ID (64-character hex string)
        """
        result = _query_indexed_api(f"tx/{txid}")
        if "error" not in result:
            return json.dumps(result)
        # Fallback to mempool.space
        data = _query_mempool_space(f"tx/{txid}")
        if isinstance(data, dict) and "error" in data:
            return json.dumps(data)
        if isinstance(data, dict):
            data["source"] = "mempool.space"
        return json.dumps(data)

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