Skip to main content
Glama

check_utxo

Verify if a Bitcoin transaction output is unspent by providing the transaction hash and output index.

Instructions

Check if a specific transaction output is unspent (UTXO lookup).

Args: txid: Transaction hash vout: Output index

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
txidYes
voutYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The `check_utxo` tool is defined in `src/bitcoin_mcp/server.py` as an MCP tool, using `get_rpc().gettxout()` to query the transaction output status.
    def check_utxo(txid: str, vout: int) -> str:
        """Check if a specific transaction output is unspent (UTXO lookup).
    
        Args:
            txid: Transaction hash
            vout: Output index
        """
        result = get_rpc().gettxout(txid, vout)
        if result is None:
            return json.dumps({"spent": True, "message": "Output is spent or does not exist"})
        return json.dumps({"spent": False, "utxo": result})

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