Skip to main content
Glama

getTokenDetails

Retrieve detailed cryptocurrency token information including price, volume, and market data across multiple blockchain networks using DexPaprika's API.

Instructions

Get detailed information about a specific token on a network. First use getNetworks to get valid network IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkYesNetwork ID from getNetworks (e.g., "ethereum", "solana")
tokenAddressYesToken address or identifier

Implementation Reference

  • Handler function that fetches token details from the DexPaprika API endpoint and formats the response for MCP.
    async ({ network, tokenAddress }) => {
      const data = await fetchFromAPI(`/networks/${network}/tokens/${tokenAddress}`);
      return formatMcpResponse(data);
    }
  • Zod schema defining input parameters: network (string) and tokenAddress (string).
    {
      network: z.string().describe('Network ID from getNetworks (e.g., "ethereum", "solana")'),
      tokenAddress: z.string().describe('Token address or identifier')
    },
  • src/index.js:148-159 (registration)
    Registers the getTokenDetails tool using server.tool, including name, description, schema, and handler function.
    server.tool(
      'getTokenDetails',
      'Get detailed information about a specific token on a network. First use getNetworks to get valid network IDs.',
      {
        network: z.string().describe('Network ID from getNetworks (e.g., "ethereum", "solana")'),
        tokenAddress: z.string().describe('Token address or identifier')
      },
      async ({ network, tokenAddress }) => {
        const data = await fetchFromAPI(`/networks/${network}/tokens/${tokenAddress}`);
        return formatMcpResponse(data);
      }
    );
  • Shared helper function used by getTokenDetails to make API requests to DexPaprika with error handling.
    async function fetchFromAPI(endpoint) {
      try {
        const response = await fetch(`${API_BASE_URL}${endpoint}`);
        if (!response.ok) {
          if (response.status === 410) {
            throw new Error(
              'This endpoint has been permanently removed. Please use network-specific endpoints instead. ' +
              'For example, use /networks/{network}/pools instead of /pools. ' +
              'Get available networks first using the getNetworks function.'
            );
          }
          if (response.status === 429) {
            throw new Error(
              'Rate limit exceeded. You have reached the maximum number of requests allowed for the free tier. ' +
              'To increase your rate limits and access additional features, please consider upgrading to a paid plan at https://docs.dexpaprika.com/'
            );
          }
          throw new Error(`API request failed with status ${response.status}`);
        }
        return await response.json();
      } catch (error) {
        console.error(`Error fetching from API: ${error.message}`);
        throw error;
      }
    }
  • Shared helper function used by getTokenDetails to format API response for MCP protocol.
    function formatMcpResponse(data) {
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(data)
          }
        ]
      };
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.0.0
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

A3.7/5.0
Behavior3/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 mentions the prerequisite of using getNetworks first, which adds useful context about dependencies. However, it doesn't describe what 'detailed information' includes, potential rate limits, error conditions, or authentication requirements, leaving significant behavioral aspects unspecified.

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 extremely concise with only two sentences, both of which earn their place. The first sentence states the core purpose, and the second provides essential usage guidance. There's no wasted language or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 2 parameters with full schema coverage but no annotations and no output schema, the description provides adequate basic context about what the tool does and a prerequisite. However, for a tool that presumably returns detailed token information, the description should ideally specify what kind of information is returned (metadata, pricing, supply, etc.) since there's no output schema to document this.

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 already documents both parameters thoroughly. The description doesn't add any meaningful parameter semantics beyond what's in the schema - it mentions network IDs but doesn't provide additional context about token address formats or validation rules. This meets 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 verb 'Get' and resource 'detailed information about a specific token on a network', making the purpose understandable. However, it doesn't explicitly distinguish this tool from sibling tools like getTokenPools or getTokenMultiPrices, which likely provide different token-related information.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance to 'First use getNetworks to get valid network IDs', which is helpful context for proper usage. However, it doesn't specify when to use this tool versus alternatives like getTokenPools or getTokenMultiPrices, nor does it mention any exclusions or prerequisites beyond the network ID requirement.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.