Skip to main content
Glama

fetchTickers

Retrieve current market prices and trading data for cryptocurrency pairs from supported exchanges, enabling real-time market analysis and trading decisions.

Instructions

Fetch all tickers from an exchange

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exchangeIdYesExchange ID (e.g., 'binance', 'coinbase')
symbolsNoOptional list of specific symbols to fetch

Implementation Reference

  • The handler function that executes the fetchTickers tool logic: gets public exchange instance via ccxtServer and calls exchange.fetchTickers(symbols), returns JSON stringified tickers or error.
    async ({ exchangeId, symbols }) => {
      try {
        // 공개 인스턴스 사용
        const exchange = ccxtServer.getPublicExchangeInstance(exchangeId);
        const tickers = await exchange.fetchTickers(symbols);
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(tickers, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error fetching tickers: ${(error as Error).message}`
            }
          ],
          isError: true
        };
      }
    }
  • Input schema using Zod for fetchTickers tool: exchangeId (string), symbols (optional string array).
    {
      exchangeId: z.string().describe("Exchange ID (e.g., 'binance', 'coinbase')"),
      symbols: z.array(z.string()).optional().describe("Optional list of specific symbols to fetch")
    },
  • The server.tool() call that registers the fetchTickers MCP tool, specifying name, description, input schema, and handler function.
    server.tool(
      "fetchTickers",
      "Fetch all tickers from an exchange",
      {
        exchangeId: z.string().describe("Exchange ID (e.g., 'binance', 'coinbase')"),
        symbols: z.array(z.string()).optional().describe("Optional list of specific symbols to fetch")
      },
      async ({ exchangeId, symbols }) => {
        try {
          // 공개 인스턴스 사용
          const exchange = ccxtServer.getPublicExchangeInstance(exchangeId);
          const tickers = await exchange.fetchTickers(symbols);
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(tickers, null, 2)
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error fetching tickers: ${(error as Error).message}`
              }
            ],
            isError: true
          };
        }
      }
    );
  • src/server.ts:372-372 (registration)
    Top-level call to registerMarketTools(server, ccxtServer), which in turn registers the fetchTickers tool among other market tools.
    registerMarketTools(this.server, this);
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 the action ('fetch') but doesn't cover critical aspects like whether this is a read-only operation, potential rate limits, authentication requirements, error handling, or the format/scope of returned data (e.g., all tickers vs. filtered). This leaves significant gaps for an agent to understand how to use it effectively.

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, direct sentence with no wasted words. It's front-loaded with the core purpose ('fetch all tickers'), making it highly efficient and easy to parse, though this conciseness comes at the cost of completeness.

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 moderate complexity (fetching financial data with parameters), lack of annotations, and no output schema, the description is insufficient. It doesn't address behavioral traits, usage context, or return values, leaving the agent with incomplete information to operate the tool reliably in a real-world scenario.

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 input schema has 100% description coverage, clearly documenting both parameters ('exchangeId' and optional 'symbols'). The description adds no additional semantic context beyond what's in the schema (e.g., it doesn't explain what 'tickers' include or how 'symbols' filtering works), so it meets the baseline for adequate but unenhanced parameter documentation.

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 ('tickers from an exchange'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'fetchTicker' (singular) or 'fetchMarkets', leaving room for ambiguity about what specifically distinguishes this tool.

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 'fetchTicker' (for a single ticker) or 'fetchMarkets' (which might include ticker data). There's no mention of prerequisites, exclusions, or specific contexts where this tool is preferred.

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/lazy-dinosaur/ccxt-mcp'

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