Skip to main content
Glama
token-metrics

Token Metrics MCP Server

Official

get_top_tokens_by_market_cap

Fetch top cryptocurrencies by market capitalization using Token Metrics API. Specify the number of tokens (up to 100) and control pagination to retrieve precise data for crypto analysis and decision-making.

Instructions

Fetch the the list of coins with top market cap from Token Metrics API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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.
top_kNoSpecifies the number of top cryptocurrencies to retrieve, based on their market capitalization. Default is 50. Maximum is 100. Exmaple: 100

Implementation Reference

  • Specific handler that performs the API request to the '/top-market-cap-tokens' endpoint using input parameters.
    protected async performApiRequest(
      input: TopTokensInput,
    ): Promise<TokenMetricsResponse> {
      this.validateApiKey();
      const params = this.buildParams(input);
    
      return (await this.makeApiRequest(
        "/top-market-cap-tokens",
        params,
      )) as TokenMetricsResponse;
    }
  • Tool definition including name, description, and input schema for parameters top_k and page.
    getToolDefinition(): Tool {
      return {
        name: "get_top_tokens_by_market_cap",
        description:
          "Fetch the the list of coins with top market cap from Token Metrics API.",
        inputSchema: {
          type: "object",
          properties: {
            top_k: {
              type: "number",
              description:
                "Specifies the number of top cryptocurrencies to retrieve, based on their market capitalization. Default is 50. Maximum is 100. Exmaple: 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;
    }
  • Registration of TopTokensTool instance in the AVAILABLE_TOOLS array.
    new CryptoInvestorTool(),
    new TopTokensTool(),
    new ResistanceSupportTool(),
  • Base execute method called by MCP to run the tool, which invokes the specific performApiRequest and formats the response.
    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,
        };
      }
    }
  • Validation of API key before making requests (inherited but called here).
        "/top-market-cap-tokens",
        params,
      )) as TokenMetricsResponse;
    }
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 fetching data but lacks details on rate limits, authentication needs, error handling, or response format. For a data retrieval tool with zero 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.

Conciseness4/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 without unnecessary words. However, it contains a minor typo ('the the'), and could be slightly improved in structure, but overall it is well-sized and front-loaded.

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 of fetching market data, no annotations, and no output schema, the description is incomplete. It lacks details on behavioral traits, response format, and usage context, making it inadequate for an agent to fully understand how to interact with this tool effectively.

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 clear documentation for both parameters ('page' and 'top_k'). The description adds no additional parameter semantics beyond what the schema provides, such as default values or usage examples, so it meets the baseline for adequate but not enhanced 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 ('fetch') and resource ('list of coins with top market cap from Token Metrics API'), making the purpose understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'get_market_metrics' or 'get_tokens_data' which might also retrieve market-related data, preventing a perfect score.

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. With many sibling tools available (e.g., 'get_market_metrics', 'get_tokens_data'), there is no indication of specific use cases, prerequisites, or comparisons, leaving the agent without contextual direction.

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