Skip to main content
Glama
truss44

Crypto Price & Market Analysis MCP Server

get-historical-analysis

Analyze historical cryptocurrency prices by specifying a symbol, time interval, and days. Use this tool to track market trends and make informed decisions with customizable timeframe data.

Instructions

Get historical price analysis with customizable timeframe

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoNumber of days to analyze (1-30)
intervalNoTime interval (m5, m15, m30, h1, h2, h6, h12, d1)h1
symbolYesCryptocurrency symbol (e.g., BTC, ETH)

Implementation Reference

  • The handler function that implements the logic for get-historical-analysis tool: parses args, fetches asset and historical data from CoinCap, formats and returns analysis.
    export async function handleGetHistoricalAnalysis(args: unknown) {
      const { symbol, interval, days } = GetHistoricalAnalysisSchema.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}` }],
          };
        }
    
        const end = Date.now();
        const start = end - (days * 24 * 60 * 60 * 1000);
        const historyData = await getHistoricalData(asset.id, interval, start, end);
    
        if (!historyData) {
          return {
            content: [{ type: "text", text: "Failed to retrieve historical data" }],
          };
        }
    
        if (!historyData.data.length) {
          return {
            content: [{ type: "text", text: "No historical data available for the selected time period" }],
          };
        }
    
        return {
          content: [{ type: "text", text: formatHistoricalAnalysis(asset, historyData.data) }],
        };
      } catch (error) {
        return {
          content: [{ 
            type: "text", 
            text: error instanceof Error ? error.message : `Failed to retrieve historical data: ${String(error)}` 
          }],
        };
      }
    }
  • Input schema using Zod for validating symbol, interval, and days parameters for the get-historical-analysis tool.
    export const GetHistoricalAnalysisSchema = z.object({
      symbol: z.string().min(1),
      interval: z.enum(['m5', 'm15', 'm30', 'h1', 'h2', 'h6', 'h12', 'd1']).default('h1'),
      days: z.number().min(1).max(30).default(7),
    });
  • src/index.ts:65-77 (registration)
    Registers the 'get-historical-analysis' tool with the MCP server, specifying title, description, input schema, and handler function.
    server.registerTool(
      "get-historical-analysis",
      {
        title: "Get Historical Analysis",
        description:
          "Get historical price analysis with customizable timeframe",
        inputSchema: GetHistoricalAnalysisSchema.shape,
      },
      async (args, _extra) => {
        const result = await handleGetHistoricalAnalysis(args);
        return result as any;
      }
    );
Behavior2/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 states what the tool does but doesn't mention critical aspects like whether this is a read-only operation, potential rate limits, authentication requirements, or what the analysis output includes. For a tool with no annotations, this is a significant gap.

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 purpose with no wasted words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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 complexity (3 parameters, no annotations, no output schema), the description is insufficient. It doesn't explain what the analysis returns, how the parameters interact, or any behavioral constraints. For a tool that presumably returns analytical data, the lack of output information is a notable gap.

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 description mentions 'customizable timeframe' which loosely relates to the 'days' and 'interval' parameters, but it doesn't add meaningful semantics beyond what the schema already provides. With 100% schema description coverage, the baseline is 3, and the description doesn't compensate with additional insights about parameter usage or interactions.

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 ('historical price analysis'), and it adds the customizable timeframe aspect. However, it doesn't explicitly distinguish this tool from its siblings (get-crypto-price and get-market-analysis), which would be needed for 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 its siblings (get-crypto-price and get-market-analysis). It mentions 'customizable timeframe' but doesn't specify scenarios or alternatives, leaving the agent without context for selection.

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