Skip to main content
Glama

bitcoin_price

Retrieve current Bitcoin price data to monitor cryptocurrency market values and track real-time price changes for investment decisions.

Instructions

Get realtime bitcoin price

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The toolCall method, which is the core handler executing the bitcoin_price tool logic: fetches Bitcoin price data from Coincap API and formats response.
    toolCall = async () => {
      try {
        const response = await fetch(BITCOIN_PRICE_URL);
        if (!response.ok) {
          throw new Error("Error fetching coincap data");
        }
    
        const body = await response.json();
    
        return {
          content: [{ type: "text", text: `${JSON.stringify(body.data)}` }],
        };
      } catch (error) {
        return {
          content: [
            { type: "error", text: JSON.stringify((error as any).message) },
          ],
        };
      }
    };
  • Tool definition schema specifying name, description, and empty input schema (no parameters).
    toolDefinition: Tool = {
      name: this.name,
      description: "Get realtime bitcoin price",
      inputSchema: {
        type: "object",
      },
    };
  • loadTools dynamically scans src/tools for tool JS files, imports and instantiates them (including BitcoinPriceTool), and createToolsMap indexes by name for dispatch.
    export async function loadTools(): Promise<BaseTool[]> {
      try {
        const toolsPath = await findToolsPath();
        const files = await fs.readdir(toolsPath);
        const tools: BaseTool[] = [];
    
        for (const file of files) {
          if (!isToolFile(file)) {
            continue;
          }
    
          try {
            const modulePath = `file://${join(toolsPath, file)}`;
            const { default: ToolClass } = await import(modulePath);
    
            if (!ToolClass) {
              continue;
            }
    
            const tool = new ToolClass();
    
            if (
              tool.name &&
              tool.toolDefinition &&
              typeof tool.toolCall === "function"
            ) {
              tools.push(tool);
            }
          } catch (error) {
            console.error(`Error loading tool from ${file}:`, error);
          }
        }
    
        return tools;
      } catch (error) {
        console.error(`Failed to load tools:`, error);
        return [];
      }
    }
    
    export function createToolsMap(tools: BaseTool[]): Map<string, BaseTool> {
      return new Map(tools.map((tool) => [tool.name, tool]));
    }
  • src/index.ts:40-54 (registration)
    MCP server request handler for CallTool that retrieves the tool instance from map by name and invokes its toolCall method.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      if (!toolsMap) {
        throw new Error("Tools not initialized");
      }
    
      const tool = toolsMap.get(request.params.name);
      if (!tool) {
        throw new Error(
          `Unknown tool: ${request.params.name}. Available tools: ${Array.from(
            toolsMap.keys()
          ).join(", ")}`
        );
      }
      return tool.toolCall(request);
    });
  • API URL constant used in the bitcoin_price tool handler to fetch Bitcoin data.
    export const BITCOIN_PRICE_URL = "https://api.coincap.io/v2/assets/bitcoin";
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Get realtime bitcoin price' implies a read-only operation, it doesn't specify data source, update frequency, rate limits, authentication requirements, or error conditions. The description is minimal and lacks important behavioral context.

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 extremely concise at just three words, front-loaded with the core functionality. Every word earns its place: 'Get' specifies the action, 'realtime' provides important temporal context, and 'bitcoin price' identifies the resource.

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?

For a simple price lookup tool with no parameters and no output schema, the description is minimally adequate. However, without annotations and with sibling tools that might overlap in functionality, more context about what makes this tool distinct would be beneficial. The description doesn't specify return format, currency, or data source.

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 tool has 0 parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, and the empty input schema is correctly documented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('bitcoin price'), and includes the qualifier 'realtime' which distinguishes it from historical or aggregated price tools. However, it doesn't explicitly differentiate from sibling tools like 'get_crypto_price' which might also provide bitcoin prices.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_crypto_price' or 'list_assets'. It doesn't mention any prerequisites, limitations, or specific contexts where this tool is preferred over siblings.

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/QuantGeekDev/coincap-mcp'

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