Skip to main content
Glama
token-metrics

Token Metrics MCP Server

Official

get_tokens_data

Fetch detailed cryptocurrency token data using ID, symbol, category, exchange, or blockchain address. Retrieve real-time insights like market data, trading signals, and price predictions for informed decision-making.

Instructions

Fetch token(s) data from Token Metrics API. Provide either token_id or symbol (or both) along with optional date range.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blockchain_addressNoUse this parameter to search tokens through specific blockchains and contract addresses. Input the blockchain name followed by a colon and then the contract address. Example: binance-smart-chain:0x57185189118c7e786cafd5c71f35b16012fa95ad
categoryNoComma Separated category name. Example: yield farming,defi
exchangeNoComma Separated exchange name. Example: binance,gate
limitNoLimit the number of results returned. Default is 50. Maximum is 100.
pageNoEnables pagination and data retrieval control by skipping a specified number of items before fetching data. Page should be a non-negative integer, with 1 indicating the beginning of the dataset.
symbolNoComma-separated string of token symbols (e.g., 'BTC,ETH,ADA')
token_idNoComma-separated string of token IDs (e.g., '1,2,3')
token_nameNoComma Separated Crypto Asset Names (e.g., Bitcoin, Ethereum)

Implementation Reference

  • The performApiRequest method, specific to TokenDataTool, implements the tool logic by preparing parameters and calling the Token Metrics API at /tokens endpoint.
      protected async performApiRequest(
        input: TokenDataInput,
      ): Promise<TokenMetricsResponse> {
        this.validateApiKey();
        const params = this.buildParams(input);
    
        return (await this.makeApiRequest(
          "/tokens",
          params,
        )) as TokenMetricsResponse;
      }
    }
  • The getToolDefinition method defines the tool's name, description, and input schema for validation.
    getToolDefinition(): Tool {
      return {
        name: "get_tokens_data",
        description:
          "Fetch token(s) data from Token Metrics API. Provide either token_id or symbol (or both) along with optional date range.",
        inputSchema: {
          type: "object",
          properties: {
            token_id: {
              type: "string",
              description: "Comma-separated string of token IDs (e.g., '1,2,3')",
            },
            token_name: {
              type: "string",
              description:
                "Comma Separated Crypto Asset Names (e.g., Bitcoin, Ethereum)",
            },
            symbol: {
              type: "string",
              description:
                "Comma-separated string of token symbols (e.g., 'BTC,ETH,ADA')",
            },
            category: {
              type: "string",
              description:
                "Comma Separated category name. Example: yield farming,defi",
            },
            exchange: {
              type: "string",
              description: "Comma Separated exchange name. Example: binance,gate",
            },
            blockchain_address: {
              type: "string",
              description:
                "Use this parameter to search tokens through specific blockchains and contract addresses. Input the blockchain name followed by a colon and then the contract address. Example: binance-smart-chain:0x57185189118c7e786cafd5c71f35b16012fa95ad",
            },
            limit: {
              type: "number",
              description:
                "Limit the number of results returned. Default is 50. Maximum is 100.",
            },
            page: {
              type: "number",
              description:
                "Enables pagination and data retrieval control by skipping a specified number of items before fetching data. Page should be a non-negative integer, with 1 indicating the beginning of the dataset.",
            },
          },
          required: [],
        },
      } as Tool;
    }
  • Instantiation and registration of TokenDataTool in the central AVAILABLE_TOOLS array, which is likely used by the MCP server.
    // Registry of all available tools
    export const AVAILABLE_TOOLS: BaseTool[] = [
      new TokenDataTool(),
      new PriceTool(),
      new HourlyOHLCVTool(),
      new DailyOHLCVTool(),
      new TokenInvestorGradeTool(),
      new MarketMetricsTool(),
      new TokenTradingSignalTool(),
      new AiReportTool(),
      new CryptoInvestorTool(),
      new TopTokensTool(),
      new ResistanceSupportTool(),
      new SentimentTool(),
      new QuantMetricsTool(),
      new ScenarioAnalysisTool(),
      new CorrelationTool(),
      new IndicesTool(),
      new IndicesHoldingsTool(),
      new IndicesPerformanceTool(),
      new TokenHourlyTradingSignalTool(),
      new MoonshotTokensTool(),
      new TokenTmGradeTool(),
      new TokenTmGradeHistoricalTool(),
      new TokenTechnologyGradeTool(),
    ];
  • The execute method from the base class, called when the tool is invoked, handles API call execution and response formatting.
    async execute(args: any): Promise<ToolResponse> {
      try {
        const result = await this.performApiRequest(args);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error fetching data: ${
                error instanceof Error ? error.message : String(error)
              }`,
            },
          ],
          isError: true,
        };
      }
    }
  • The makeApiRequest helper performs the HTTP request to the Token Metrics API using axios, with authentication and comprehensive error handling.
    protected async makeApiRequest(
      endpoint: string,
      params: Record<string, string | number>,
    ): Promise<TokenMetricsBaseResponse> {
      try {
        const response = await axios.get(`${this.apiBaseUrl}${endpoint}`, {
          params,
          headers: {
            Accept: "application/json",
            "x-api-key": this.apiKey,
            "x-integration": "mcp",
          },
          timeout: 30000,
        });
    
        return response.data as TokenMetricsBaseResponse;
      } catch (error) {
        console.error(`[ERROR] API request failed:`, error);
    
        if (axios.isAxiosError(error)) {
          if (error.response) {
            const errorMsg = `API Error (${
              error.response.status
            }): ${JSON.stringify(error.response.data)}`;
            console.error(`[ERROR] ${errorMsg}`);
            throw new Error(errorMsg);
          } else if (error.request) {
            const errorMsg = "Network error: Unable to reach Token Metrics API";
            console.error(`[ERROR] ${errorMsg}`);
            throw new Error(errorMsg);
          }
        }
        const errorMsg = `Request failed: ${
          error instanceof Error ? error.message : String(error)
        }`;
        console.error(`[ERROR] ${errorMsg}`);
        throw new Error(errorMsg);
      }
    }
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. It mentions fetching data but fails to describe key behaviors: what specific data is returned (e.g., metrics, metadata), whether it's read-only (implied but not stated), pagination details (only hinted via 'limit' and 'page' in schema), rate limits, or authentication needs. This leaves significant gaps for a tool with 8 parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/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. It avoids redundancy and wastes no words, though it could be slightly more structured (e.g., separating purpose from parameter guidance). Given the complexity, it's appropriately concise without being under-specified.

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 (8 parameters, no annotations, no output schema, and many siblings), the description is incomplete. It doesn't explain what data is fetched (e.g., types of metrics), how results are structured, or how to interpret outputs. With no output schema and rich sibling tools, more context is needed to guide effective use.

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 schema fully documents all 8 parameters. The description adds minimal value beyond the schema, mentioning 'token_id or symbol (or both) along with optional date range' but not explaining other parameters like 'blockchain_address' or 'category'. This meets the baseline of 3 since the schema does the heavy lifting, but the description doesn't enhance understanding of parameter interactions or semantics.

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 ('Fetch') and resource ('token(s) data from Token Metrics API'), making the purpose understandable. It distinguishes itself from siblings by focusing on general token data retrieval rather than specific metrics like price, OHLCV, or investor grades. However, it doesn't explicitly differentiate from all siblings (e.g., 'get_tokens_quant_metrics' might overlap).

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 minimal guidance, mentioning 'Provide either token_id or symbol (or both) along with optional date range' but offers no context on when to use this tool versus alternatives like 'get_tokens_price' or 'get_tokens_quant_metrics'. It lacks explicit when-to-use or when-not-to-use statements, leaving the agent to infer from sibling names alone.

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/token-metrics/mcp'

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