Skip to main content
Glama
recallnet

Trading Simulator MCP Server

by recallnet

get_price_history

Retrieve historical price data for tokens by specifying time range and interval to analyze market trends in trading simulations.

Instructions

Get historical price data for a token

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesToken address
startTimeNoStart time as ISO timestamp
endTimeNoEnd time as ISO timestamp
intervalNoTime interval for price points
chainNoOptional blockchain type
specificChainNoOptional specific chain for EVM tokens

Implementation Reference

  • src/index.ts:212-250 (registration)
    Registers the 'get_price_history' tool in the TRADING_SIM_TOOLS array used by the MCP server, including name, description, and detailed JSON input schema.
    {
      name: "get_price_history",
      description: "Get historical price data for a token",
      inputSchema: {
        type: "object",
        properties: {
          token: {
            type: "string",
            description: "Token address"
          },
          startTime: {
            type: "string",
            description: "Start time as ISO timestamp"
          },
          endTime: {
            type: "string",
            description: "End time as ISO timestamp"
          },
          interval: {
            type: "string",
            enum: ["1m", "5m", "15m", "1h", "4h", "1d"],
            description: "Time interval for price points"
          },
          chain: {
            type: "string",
            enum: ["svm", "evm"],
            description: "Optional blockchain type"
          },
          specificChain: {
            type: "string",
            enum: ["eth", "polygon", "bsc", "arbitrum", "base", "optimism", "avalanche", "linea", "svm"],
            description: "Optional specific chain for EVM tokens"
          }
        },
        required: ["token"],
        additionalProperties: false,
        $schema: "http://json-schema.org/draft-07/schema#"
      }
    },
  • The main handler logic for the 'get_price_history' tool call within the MCP server's CallToolRequestSchema handler. Validates arguments, builds PriceHistoryParams, calls the tradingClient helper, and formats the response.
    case "get_price_history": {
      if (!args || typeof args !== "object" || !("token" in args)) {
        throw new Error("Invalid arguments for get_price_history");
      }
      
      const historyParams: PriceHistoryParams = {
        token: args.token as string
      };
      
      if ("startTime" in args) historyParams.startTime = args.startTime as string;
      if ("endTime" in args) historyParams.endTime = args.endTime as string;
      if ("interval" in args) historyParams.interval = args.interval as PriceHistoryParams['interval'];
      if ("chain" in args) historyParams.chain = args.chain as BlockchainType;
      if ("specificChain" in args) historyParams.specificChain = args.specificChain as SpecificChain;
      
      const response = await tradingClient.getPriceHistory(historyParams);
      return {
        content: [{ type: "text", text: JSON.stringify(response, null, 2) }],
        isError: false
      };
    }
  • Helper method in TradingSimulatorClient that implements the actual API call for price history. Constructs query parameters and performs GET request to the backend /api/price/history endpoint.
    async getPriceHistory(
      tokenOrParams: string | PriceHistoryParams,
      interval?: string,
      chain?: BlockchainType,
      specificChain?: SpecificChain,
      startTime?: string,
      endTime?: string
    ): Promise<PriceHistoryResponse | ErrorResponse> {
      const urlParams = new URLSearchParams();
      
      // Handle both object-based and individual parameter calls
      if (typeof tokenOrParams === 'object') {
        // Object parameter version
        const params = tokenOrParams;
        urlParams.append('token', params.token);
        
        if (params.startTime) urlParams.append('startTime', params.startTime);
        if (params.endTime) urlParams.append('endTime', params.endTime);
        if (params.interval) urlParams.append('interval', params.interval);
        if (params.chain) urlParams.append('chain', params.chain);
        if (params.specificChain) urlParams.append('specificChain', params.specificChain);
      } else {
        // Individual parameters version
        urlParams.append('token', tokenOrParams);
        
        if (interval) urlParams.append('interval', interval);
        if (chain) urlParams.append('chain', chain);
        if (specificChain) urlParams.append('specificChain', specificChain);
        if (startTime) urlParams.append('startTime', startTime);
        if (endTime) urlParams.append('endTime', endTime);
      }
    
      return this.request<PriceHistoryResponse>(
        'GET', 
        `/api/price/history?${urlParams.toString()}`,
        null,
        'get price history'
      );
    }
  • TypeScript interface definition for PriceHistoryParams used in the tool handler and API client for input validation and typing.
    export interface PriceHistoryParams {
      token: string;
      startTime?: string;
      endTime?: string;
      interval?: '1m' | '5m' | '15m' | '1h' | '4h' | '1d';
      chain?: BlockchainType;
      specificChain?: SpecificChain;
    }
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 states what the tool does but lacks critical behavioral details: it doesn't specify the return format (e.g., array of price points), data sources, rate limits, authentication requirements, or error handling. For a tool with 6 parameters and no annotation coverage, this is a significant gap in transparency.

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 front-loads the core purpose without unnecessary words. Every part of the sentence earns its place by specifying the action, data type, and target resource. No structural issues or redundancy are present.

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 tool's complexity (6 parameters, no output schema, no annotations), the description is incomplete. It lacks details on return values, data format, limitations (e.g., date ranges supported), and behavioral context. While the schema covers parameters well, the overall context for effective tool use is insufficient, especially for a data retrieval tool with multiple options.

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?

Schema description coverage is 100%, with all parameters well-documented in the schema itself (e.g., 'token address', 'ISO timestamp', 'time interval'). The description adds no additional parameter semantics beyond the schema, as it doesn't explain parameter interactions, defaults, or usage examples. Baseline 3 is appropriate when the schema does the heavy lifting.

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 action ('Get') and resource ('historical price data for a token'), making the purpose immediately understandable. It distinguishes this from sibling tools like 'get_price' (which likely provides current price) by specifying historical data. However, it doesn't explicitly differentiate from other historical data tools if they existed, though none are present in the sibling list.

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. While it implies usage for historical price retrieval, it doesn't mention when to choose this over 'get_price' (for current prices) or other tools like 'get_token_info' (which might include some price data). No exclusions, prerequisites, or context for selection are provided.

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/recallnet/trading-simulator-mcp'

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