Skip to main content
Glama

get_btc_price

Retrieve the current Bitcoin price in USD through the Lightning Enable MCP server. This tool provides real-time BTC pricing data for use in automated Lightning Network payment calculations and transactions.

Instructions

Get the current Bitcoin price in USD. Only available with Strike wallet.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_btc_price' MCP tool. It verifies the Strike wallet and calls the wallet's own get_btc_price method.
    async def get_btc_price(
        wallet: "StrikeWallet | None" = None,
    ) -> str:
        """
        Get the current Bitcoin price in USD.
    
        Uses Strike's rate ticker API to get the current BTC/USD exchange rate.
        Only available with Strike wallet.
    
        Args:
            wallet: Strike wallet instance
    
        Returns:
            JSON with current BTC price in USD
        """
        if not wallet:
            return json.dumps({
                "success": False,
                "error": "Wallet not configured. Set STRIKE_API_KEY environment variable for price data."
            })
    
        # Verify it's a Strike wallet
        from ..strike_wallet import StrikeWallet
        if not isinstance(wallet, StrikeWallet):
            provider_name = type(wallet).__name__.replace("Wallet", "")
            return json.dumps({
                "success": False,
                "error": f"Price ticker is only available with Strike wallet. Current wallet: {provider_name}",
                "errorCode": "NOT_SUPPORTED",
                "hint": "Set STRIKE_API_KEY environment variable for price data."
            })
    
        try:
            result = await wallet.get_btc_price()
    
            if not result.success:
                return json.dumps({
                    "success": False,
                    "error": result.error_message,
                    "errorCode": result.error_code,
                })
    
            return json.dumps({
                "success": True,
                "provider": "Strike",
                "ticker": {
                    "btcUsd": float(result.btc_usd_price),
                },
                "message": f"Current BTC price: ${result.btc_usd_price:,.2f} USD"
            }, indent=2)
    
        except Exception as e:
            logger.exception("Error getting BTC price")
            return json.dumps({
                "success": False,
                "error": sanitize_error(str(e))
            })
  • Registration of the 'get_btc_price' tool in the MCP server's list_tools handler.
        name="get_btc_price",
        description=(
            "Get the current Bitcoin price in USD. "
            "Only available with Strike wallet."
        ),
        inputSchema={
            "type": "object",
            "properties": {},
        },
    ),
    Tool(
  • Invocation of the 'get_btc_price' tool handler in the MCP server's call_tool handler.
    elif name == "get_btc_price":
        result = await get_btc_price(
            wallet=self.strike_wallet,
        )
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the dependency on 'Strike wallet,' which is useful context, but lacks details on rate limits, error handling, or response format. The description does not contradict annotations, but it could provide more behavioral insights for a tool with external dependencies.

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 highly concise and front-loaded, consisting of two sentences that efficiently convey the core functionality and a critical constraint. Every word serves a purpose, with no redundant or unnecessary information, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate but has gaps. It explains what the tool does and a key dependency, but lacks details on return values (e.g., numeric price, timestamp) or potential errors, which could hinder an agent's ability to use it effectively without trial and error.

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?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately does not discuss parameters, focusing instead on the tool's purpose and constraints, which aligns with the baseline expectation for zero-parameter tools.

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'), resource ('current Bitcoin price'), and unit ('in USD'), making the purpose unambiguous. It distinguishes itself from siblings like 'exchange_currency' by focusing solely on Bitcoin price retrieval without conversion or other financial operations.

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 provides clear context by specifying 'Only available with Strike wallet,' which indicates a prerequisite or dependency. However, it does not explicitly state when to use this tool versus alternatives (e.g., 'exchange_currency' for other currencies or conversions), leaving some ambiguity in sibling differentiation.

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/refined-element/lightning-enable-mcp'

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