Skip to main content
Glama

get_token_historical_data

Retrieve historical price and trading data for a specific token on SailFish DEX by specifying the token address and desired time range in days.

Instructions

Get historical data for a token on SailFish DEX

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoNumber of days of data to return (default: 7)
tokenIdYesToken address

Implementation Reference

  • Core handler function that executes the GraphQL query to fetch historical daily data for the specified token from the SailFish subgraph.
    export async function getTokenDayData(tokenId: string, count: number = 7): Promise<TokenDayData[]> {
      try {
        const data = await request<TokenDayDataQueryResult>(
          SUBGRAPH_URL,
          TOKEN_DAY_DATA_QUERY,
          { tokenId: tokenId.toLowerCase(), count }
        );
        return data.tokenDayDatas;
      } catch (error) {
        console.error('Error fetching token day data:', error);
        throw error;
      }
    }
  • src/index.ts:833-849 (registration)
    MCP CallToolRequestSchema handler registration for 'get_token_historical_data': validates parameters, delegates to subgraph.getTokenDayData, formats and returns response.
    case 'get_token_historical_data': {
      if (!args.tokenId || typeof args.tokenId !== 'string') {
        throw new McpError(ErrorCode.InvalidParams, 'Token ID is required');
      }
      
      const days = typeof args.days === 'number' ? args.days : 7;
      const data = await subgraph.getTokenDayData(args.tokenId, days);
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(data, null, 2),
          },
        ],
      };
    }
  • Input schema definition for the tool, used in ListToolsRequestSchema response.
    name: 'get_token_historical_data',
    description: 'Get historical data for a token on SailFish DEX',
    inputSchema: {
      type: 'object',
      properties: {
        tokenId: {
          type: 'string',
          description: 'Token address',
        },
        days: {
          type: 'number',
          description: 'Number of days of data to return (default: 7)',
        },
      },
      required: ['tokenId'],
    },
  • GraphQL query definition used by getTokenDayData to retrieve token historical day data.
    const TOKEN_DAY_DATA_QUERY = gql`
      query getTokenDayData($tokenId: String!, $count: Int!) {
        tokenDayDatas(
          first: $count
          orderBy: date
          orderDirection: desc
          where: { token: $tokenId }
        ) {
          id
          date
          token {
            id
            symbol
            name
          }
          volume
          volumeUSD
          untrackedVolumeUSD
          totalValueLocked
          totalValueLockedUSD
          priceUSD
          feesUSD
          open
          high
          low
          close
        }
      }
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 the tool's function but lacks details on rate limits, authentication needs, data format, or potential side effects. This is inadequate for a tool that likely involves network calls and data retrieval.

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 with zero wasted words. It front-loads the core purpose ('Get historical data') and specifies the resource and context appropriately, making it easy 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 no annotations and no output schema, the description is incomplete. It doesn't explain what 'historical data' includes (e.g., price, volume, timestamps) or the return format, which is critical for an agent to use this tool effectively in a DEX context with many sibling tools.

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%, so the input schema fully documents the parameters ('days' and 'tokenId'). The description adds no additional semantic context beyond what's in the schema, such as token format examples or day range limitations, meeting the baseline for high schema coverage.

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 historical data') and resource ('for a token on SailFish DEX'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'get_pool_historical_data' or 'get_token_price', which might offer related historical or token data.

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. It doesn't mention prerequisites, exclusions, or compare to siblings such as 'get_token_info' or 'get_pool_historical_data', leaving the agent to infer usage context.

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/SailFish-Finance/educhain-ai-agent-kit'

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