Skip to main content
Glama
truss44

Crypto Price & Market Analysis MCP Server

get-crypto-price

Fetch current price and 24-hour statistics for any cryptocurrency by providing its symbol. Access real-time data for informed market analysis.

Instructions

Get current price and 24h stats for a cryptocurrency

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesCryptocurrency symbol (e.g., BTC, ETH)

Implementation Reference

  • The handler function that executes the get-crypto-price tool logic: parses input symbol, fetches assets from CoinCap, finds the asset, formats price info, handles errors.
    export async function handleGetPrice(args: unknown) {
      const { symbol } = GetPriceArgumentsSchema.parse(args);
      const upperSymbol = symbol.toUpperCase();
    
      try {
        const assetsData = await getAssets();
        
        if (!assetsData) {
          return {
            content: [{ type: "text", text: "Failed to retrieve cryptocurrency data" }],
          };
        }
        
        const asset = assetsData.data.find(
          (a: { symbol: string; }) => a.symbol.toUpperCase() === upperSymbol
        );
    
        if (!asset) {
          return {
            content: [
              {
                type: "text",
                text: `Could not find cryptocurrency with symbol ${upperSymbol}`,
              },
            ],
          };
        }
    
        return {
          content: [{ type: "text", text: formatPriceInfo(asset) }],
        };
      } catch (error) {
        return {
          content: [{ 
            type: "text", 
            text: error instanceof Error ? error.message : `Failed to retrieve cryptocurrency data: ${String(error)}` 
          }],
        };
      }
    }
  • Zod input schema defining the 'symbol' parameter for the tool.
    export const GetPriceArgumentsSchema = z.object({
      symbol: z.string().min(1),
    });
  • src/index.ts:38-49 (registration)
    Registers the 'get-crypto-price' tool on the MCP server with title, description, input schema, and handler.
    server.registerTool(
      "get-crypto-price",
      {
        title: "Get Crypto Price",
        description: "Get current price and 24h stats for a cryptocurrency",
        inputSchema: GetPriceArgumentsSchema.shape,
      },
      async (args, _extra) => {
        const result = await handleGetPrice(args);
        return result as any;
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'Get current price and 24h stats', which implies a read-only operation, but fails to detail critical aspects like rate limits, error handling, data sources, or response format. This leaves significant gaps in understanding how the tool behaves in practice.

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 a single, efficient sentence that directly states the tool's function without unnecessary words. It is front-loaded with the core purpose, making it easy to parse and understand quickly, with zero wasted content.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete for effective tool use. It does not explain what the return values include (e.g., price units, 24h stats details) or address potential complexities like handling invalid symbols. For a tool with no structured behavioral data, more context is needed to ensure reliable agent invocation.

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

Parameters3/5

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

The input schema has 100% description coverage, with the 'symbol' parameter well-documented. The description adds no additional meaning beyond the schema, such as examples of valid symbols or constraints. Given the high schema coverage, the baseline score of 3 is appropriate, as the schema handles the parameter documentation adequately.

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 verb ('Get') and resource ('current price and 24h stats for a cryptocurrency'), making the purpose specific and understandable. However, it does not explicitly differentiate from sibling tools like 'get-historical-analysis' or 'get-market-analysis', which likely provide different types of cryptocurrency data, preventing a score of 5.

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, such as the sibling tools 'get-historical-analysis' or 'get-market-analysis'. It lacks explicit context, exclusions, or prerequisites, leaving usage decisions ambiguous for an AI agent.

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

Related 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/truss44/mcp-crypto-price'

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