Skip to main content
Glama
kukapay

bitcoin-utxo-mcp

get_utxo

Retrieve Unspent Transaction Outputs (UTXOs) for any Bitcoin address to check available balance and transaction details.

Instructions

Get UTXO for a Bitcoin address.

Args:
    address (str): Bitcoin address (base58 or bech32 format)

Returns:
    A string containing:
    - Address
    - Number of UTXOs
    - Total value in BTC
    - List of UTXO details (txid, value, confirmations)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:10-42 (handler)
    The handler function for the 'get_utxo' tool. It is decorated with @mcp.tool() for registration and implements the logic to fetch unspent transaction outputs (UTXOs) for a given Bitcoin address using the blockchain.info API, processes the data, and returns a formatted string summary.
    @mcp.tool()
    async def get_utxo(address: str) -> str:
        """Get UTXO for a Bitcoin address.
        
        Args:
            address (str): Bitcoin address (base58 or bech32 format)
        
        Returns:
            A string containing:
            - Address
            - Number of UTXOs
            - Total value in BTC
            - List of UTXO details (txid, value, confirmations)
        """
        async with httpx.AsyncClient() as client:
            try:
                response = await client.get(f"https://blockchain.info/unspent?active={address}")
                response.raise_for_status()
                data = response.json()
                utxos = data.get("unspent_outputs", [])
                total_value = sum(u['value'] for u in utxos) / 1e8
                utxo_details = "\n".join(
                    f"- TXID: {u['tx_hash_big_endian']}, Value: {u['value'] / 1e8:.8f} BTC, Confirmations: {u['confirmations']}"
                    for u in utxos
                )
                return (
                    f"Address {address}:\n"
                    f"{len(utxos)} UTXOs\n"
                    f"Total Value: {total_value:.8f} BTC\n"
                    f"UTXO Details:\n{utxo_details}"
                )
            except Exception as e:
                return f"Error fetching UTXO: {str(e)}"
Behavior3/5

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

With no annotations provided, the description carries full burden. It describes the return format comprehensively but doesn't mention behavioral aspects like rate limits, authentication requirements, error conditions, or whether this is a read-only operation (though 'Get' implies it).

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?

The description is efficiently structured with a clear purpose statement followed by well-organized Args and Returns sections. Every sentence earns its place by providing essential information without 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?

Given the tool has an output schema, the description doesn't need to explain return values, yet it provides a comprehensive overview of what the tool returns. Combined with the detailed parameter information, this creates a complete picture for a single-parameter query tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by providing detailed parameter semantics: it specifies the parameter name ('address'), type ('str'), and acceptable formats ('base58 or bech32 format'), which goes well beyond the bare schema.

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?

The description clearly states the specific action ('Get UTXO') and resource ('for a Bitcoin address'), distinguishing it from the sibling tool 'get_block_stats' which presumably deals with block-level statistics rather than address-specific UTXO data.

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?

The description implies usage context by specifying it's for Bitcoin addresses, but doesn't explicitly state when to use this tool versus alternatives like 'get_block_stats' or other potential UTXO-related tools. However, the clear resource focus provides reasonable guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/kukapay/bitcoin-utxo-mcp'

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