Skip to main content
Glama

get_external_market_data

Retrieve external market data for EDU tokens from centralized exchanges to monitor prices, trends, and trading activity effectively.

Instructions

Get external market data for EDU from centralized exchanges

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that fetches EDU market data from CryptoCompare API, processes the response, and returns structured data including price, 24h changes, and metadata.
     * Fetch external market data for EDU from CryptoCompare
     */
    export async function getExternalMarketData(): Promise<{
      price: number;
      change24h: number;
      high24h: number;
      low24h: number;
      volume24h: number;
      marketCap: number;
      lastUpdate: string;
      source: string;
    }> {
      try {
        const { apiUrl, apiKey, symbols } = config;
        
        // Build request URL
        const url = `${apiUrl}?fsyms=${symbols.EDU}&tsyms=${symbols.USD}`;
        
        // Set up headers with API key if provided
        const headers: Record<string, string> = {};
        if (apiKey) {
          headers['authorization'] = `Apikey ${apiKey}`;
        }
        
        // Make API request
        const response = await axios.get(url, { headers });
        
        // Extract data
        const data = response.data;
        if (!data.RAW || !data.RAW[symbols.EDU] || !data.RAW[symbols.EDU][symbols.USD]) {
          throw new Error('Invalid response format from external API');
        }
        
        const rawData = data.RAW[symbols.EDU][symbols.USD];
        
        return {
          price: rawData.PRICE || 0,
          change24h: rawData.CHANGE24HOUR || 0,
          high24h: rawData.HIGH24HOUR || 0,
          low24h: rawData.LOW24HOUR || 0,
          volume24h: rawData.VOLUME24HOUR || 0,
          marketCap: rawData.MKTCAP || 0,
          lastUpdate: new Date(rawData.LASTUPDATE * 1000).toISOString(),
          source: 'CryptoCompare'
        };
      } catch (error) {
        console.error('Error fetching external market data:', error);
        throw error;
      }
    }
  • src/index.ts:1255-1283 (registration)
    MCP tool call handler that invokes the getExternalMarketData function from external_market module and returns the result as MCP content or handles errors.
    case 'get_external_market_data': {
      try {
        const data = await external_market.getExternalMarketData();
        
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(data, null, 2),
            },
          ],
        };
      } catch (error) {
        console.error('Error getting external market data:', error);
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({ 
                error: 'Failed to fetch external market data',
                message: (error as Error).message,
                note: 'You may need to update the external market API configuration'
              }, null, 2),
            },
          ],
          isError: true,
        };
      }
    }
  • Tool schema definition in the ListTools response, specifying the tool name, description, and empty input schema (no parameters required).
      name: 'get_external_market_data',
      description: 'Get external market data for EDU from centralized exchanges',
      inputSchema: {
        type: 'object',
        properties: {},
        required: [],
      },
    },
  • src/index.ts:612-619 (registration)
    Registration of the tool in the ListToolsRequestSchema handler, making it discoverable by MCP clients.
      name: 'get_external_market_data',
      description: 'Get external market data for EDU from centralized exchanges',
      inputSchema: {
        type: 'object',
        properties: {},
        required: [],
      },
    },
  • Helper function to retrieve the current API configuration used by the market data fetcher.
    export function getConfig(): typeof config {
      return { ...config };
    }
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 'Get external market data' but doesn't specify if this is a read-only operation, requires authentication, has rate limits, or what the output format might be. For a 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence: 'Get external market data for EDU from centralized exchanges.' It's front-loaded with the core action and resource, with zero wasted words. Every part of the sentence contributes to understanding the tool's purpose.

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 market data tools and the lack of annotations and output schema, the description is incomplete. It doesn't explain what data is returned (e.g., price, volume, timestamps), how it's formatted, or any behavioral aspects like caching or errors. For a tool in a financial context with many siblings, more detail is needed to be fully helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so there's no need for parameter details in the description. The baseline for 0 parameters is 4, as the description doesn't need to compensate for any schema gaps. It appropriately avoids redundant information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'Get external market data for EDU from centralized exchanges' which provides a clear verb ('Get') and resource ('external market data for EDU'), but it's vague about what specific data is retrieved (e.g., price, volume, order book) and doesn't distinguish from siblings like 'get_token_price' or 'get_24h_volume' that might overlap in functionality. It's not tautological but lacks specificity.

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 offers no guidance on when to use this tool versus alternatives. With siblings like 'get_token_price' and 'get_24h_volume' that might provide similar market data, there's no indication of context, exclusions, or prerequisites. Usage is implied only by the name and description, but no explicit instructions are provided.

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