Skip to main content
Glama
edkdev

DeFi Trading Agent MCP Server

by edkdev

get_token_info

Retrieve detailed token information including socials, websites, and descriptions for DeFi trading analysis and decision-making.

Instructions

Get detailed token information including socials, websites, and description

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkYesNetwork ID (e.g., 'eth', 'bsc', 'polygon_pos')
addressYesToken contract address

Implementation Reference

  • MCP tool schema definition and registration in the ListTools handler, specifying input schema requiring network and address.
      name: TOOL_NAMES.GET_TOKEN_INFO,
      description:
        "Get detailed token information including socials, websites, and description",
      inputSchema: {
        type: "object",
        properties: {
          network: {
            type: "string",
            description: "Network ID (e.g., 'eth', 'bsc', 'polygon_pos')",
          },
          address: {
            type: "string",
            description: "Token contract address",
          },
        },
        required: ["network", "address"],
      },
    },
  • src/index.js:1100-1102 (registration)
    Tool dispatching/registration in the CallToolRequestSchema handler switch statement.
    case TOOL_NAMES.GET_TOKEN_INFO:
      result = await toolService.getTokenInfo(args.network, args.address);
      break;
  • Service layer handler that validates parameters, calls CoinGeckoApiService, and formats the response for the MCP tool.
    async getTokenInfo(network, address) {
      if (!network || !address) {
        throw new Error("Missing required parameters: network, address");
      }
    
      const result = await this.coinGeckoApi.getTokenInfo(network, address);
    
      return {
        message: `Token info for ${address} on ${network} retrieved successfully`,
        data: result,
        summary: `Retrieved detailed info for token ${
          result.data?.attributes?.symbol || address
        }`,
        note: "This endpoint provides additional token information like socials, websites, and description",
      };
    }
  • Core implementation handler that performs the actual HTTP fetch to CoinGecko's onchain API endpoint for detailed token information.
    async getTokenInfo(network, address) {
      try {
        const url = `${this.baseUrl}/networks/${network}/tokens/${address}/info`;
        
        const response = await fetch(url, {
          headers: {
            'x-cg-demo-api-key': this.apiKey
          }
        });
        
        if (!response.ok) {
          throw new Error(`HTTP ${response.status}: ${response.statusText}`);
        }
        
        return await response.json();
      } catch (error) {
        throw new Error(`Failed to get token info: ${error.message}`);
      }
    }
  • Constant definition mapping the symbolic name TOOL_NAMES.GET_TOKEN_INFO to the string tool name 'get_token_info' used throughout the codebase.
    GET_TOKEN_INFO: "get_token_info",
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 this is a read operation ('Get'), but doesn't mention potential limitations like rate limits, authentication requirements, error conditions, or what happens with invalid inputs. For a tool that likely queries external APIs, this lack of transparency is a significant gap.

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 and provides specific examples of what information is retrieved. Every word serves a purpose with no redundancy 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?

For a read-only tool with 2 parameters and 100% schema coverage, the description adequately covers the basic purpose. However, without annotations or an output schema, it should ideally mention what the return format looks like (e.g., structured JSON with specific fields) or any notable behavioral aspects given the cryptocurrency/blockchain context.

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?

The schema description coverage is 100%, with both parameters (network and address) clearly documented in the schema. The description doesn't add any parameter-specific information beyond what's in the schema, such as format examples or validation rules. This meets the baseline expectation when schema coverage is complete.

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 ('detailed token information') with specific examples of what information is included ('socials, websites, and description'). It distinguishes itself from siblings like get_token_data or get_token_price by focusing on metadata rather than pricing or raw data. However, it doesn't explicitly contrast with all similar tools.

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 like get_token_data, get_token_price, or get_multiple_tokens_data. There's no mention of prerequisites, context, or exclusions, leaving the agent to infer usage based on the tool name 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

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/edkdev/defi-trading-mcp'

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