Skip to main content
Glama

batch-get-tickers

Retrieve real-time ticker data for multiple trading pairs simultaneously on supported exchanges. Specify exchange, symbols, and market type for efficient data fetching.

Instructions

Get ticker information for multiple trading pairs at once

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exchangeYesExchange ID (e.g., binance, coinbase)
marketTypeNoMarket type (default: spot)
symbolsYesList of trading pair symbols (e.g., ['BTC/USDT', 'ETH/USDT'])

Implementation Reference

  • The core handler function for the batch-get-tickers tool. It uses rate limiting, caching, fetches the appropriate exchange instance, and calls ex.fetchTickers(symbols) to retrieve ticker data for multiple symbols. Returns JSON stringified response or error.
    }, async ({ exchange, symbols, marketType }) => {
      try {
        return await rateLimiter.execute(exchange, async () => {
          const ex = marketType 
            ? getExchangeWithMarketType(exchange, marketType)
            : getExchange(exchange);
          const cacheKey = `tickers:${exchange}:${marketType || 'spot'}:${symbols.join(',')}`;
          
          const tickers = await getCachedData(cacheKey, async () => {
            log(LogLevel.INFO, `Batch fetching tickers for ${symbols.length} symbols on ${exchange}`);
            return await ex.fetchTickers(symbols);
          });
          
          return {
            content: [{
              type: "text",
              text: JSON.stringify(tickers, null, 2)
            }]
          };
        });
      } catch (error) {
        log(LogLevel.ERROR, `Error batch fetching tickers: ${error instanceof Error ? error.message : String(error)}`);
        return {
          content: [{
            type: "text",
            text: `Error: ${error instanceof Error ? error.message : String(error)}`
          }],
          isError: true
        };
      }
  • Zod input schema defining parameters for the tool: exchange (string), symbols (array of strings), and optional marketType (enum).
    exchange: z.string().describe("Exchange ID (e.g., binance, coinbase)"),
    symbols: z.array(z.string()).describe("List of trading pair symbols (e.g., ['BTC/USDT', 'ETH/USDT'])"),
    marketType: z.enum(["spot", "future", "swap", "option", "margin"]).optional().describe("Market type (default: spot)")
  • Registration of the batch-get-tickers tool with McpServer using server.tool(), providing name, description, input schema, and inline handler function.
    server.tool("batch-get-tickers", "Get ticker information for multiple trading pairs at once", {
      exchange: z.string().describe("Exchange ID (e.g., binance, coinbase)"),
      symbols: z.array(z.string()).describe("List of trading pair symbols (e.g., ['BTC/USDT', 'ETH/USDT'])"),
      marketType: z.enum(["spot", "future", "swap", "option", "margin"]).optional().describe("Market type (default: spot)")
    }, async ({ exchange, symbols, marketType }) => {
      try {
        return await rateLimiter.execute(exchange, async () => {
          const ex = marketType 
            ? getExchangeWithMarketType(exchange, marketType)
            : getExchange(exchange);
          const cacheKey = `tickers:${exchange}:${marketType || 'spot'}:${symbols.join(',')}`;
          
          const tickers = await getCachedData(cacheKey, async () => {
            log(LogLevel.INFO, `Batch fetching tickers for ${symbols.length} symbols on ${exchange}`);
            return await ex.fetchTickers(symbols);
          });
          
          return {
            content: [{
              type: "text",
              text: JSON.stringify(tickers, null, 2)
            }]
          };
        });
      } catch (error) {
        log(LogLevel.ERROR, `Error batch fetching tickers: ${error instanceof Error ? error.message : String(error)}`);
        return {
          content: [{
            type: "text",
            text: `Error: ${error instanceof Error ? error.message : String(error)}`
          }],
          isError: true
        };
      }
    });
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 states the action ('Get') but doesn't describe traits like whether this is a read-only operation (implied but not confirmed), rate limits, error handling for invalid symbols, or the format of returned ticker information. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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 without unnecessary words. It directly communicates the tool's function and scope ('multiple trading pairs at once'), making it easy to parse and understand quickly. Every part of the sentence earns its place.

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 complexity (3 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what 'ticker information' includes (e.g., price, volume), how errors are handled, or the return format. For a data-fetching tool with multiple inputs, more context is needed to guide effective use, especially without annotations or output schema.

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 fully documents all three parameters (exchange, marketType, symbols) with descriptions and enums. The description adds no additional meaning beyond what's in the schema, such as examples of ticker data or constraints on symbol formats. Baseline 3 is appropriate when the schema does the heavy lifting.

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 'ticker information for multiple trading pairs', which is specific and actionable. It distinguishes from the sibling 'get-ticker' by emphasizing 'multiple trading pairs at once', though it doesn't explicitly name the sibling. The purpose is well-defined but could be slightly more precise about what 'ticker information' entails.

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-ticker' (for single pairs) or 'get-markets' (for broader market data). It lacks context about prerequisites, such as needing valid exchange and symbol inputs, or exclusions like unsupported market types. Usage is implied by the name but not explicitly stated.

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/doggybee/mcp-server-ccxt'

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