Skip to main content
Glama

binance_market_klines

Retrieve historical candlestick data for Binance trading pairs to analyze market trends and price movements over specified time intervals.

Instructions

Get historical klines/candles for a symbol and interval.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes
intervalYes
limitNo

Implementation Reference

  • The complete implementation of the tool, including the handler function `run` that validates input and fetches klines data from the Binance client.
    export const tool_market_klines: BinanceTool = {
      name: "binance_market_klines",
      description: "Get historical klines/candles for a symbol and interval.",
      parameters: klinesSchema,
      async run(input) {
        const params = klinesSchema.parse(input);
        try {
          const res = await binance.klines(params.symbol, params.interval, { limit: params.limit });
          return res.data;
        } catch (err) {
          throw toToolError(err);
        }
      }
    };
  • Zod input schema used by the binance_market_klines tool for parameter validation.
    const klinesSchema = z.object({
      symbol: z.string().min(1),
      interval: z.string().min(1),
      limit: z.number().int().min(1).max(1000).default(200)
    });
  • src/index.ts:15-23 (registration)
    Inclusion of tool_market_klines in the tools array for registration.
    const tools = [
      tool_market_price,
      tool_market_klines,
      tool_exchange_info,
      tool_account_balances,
      tool_open_orders,
      tool_place_order,
      tool_cancel_order,
    ];
  • src/index.ts:25-40 (registration)
    Registration loop that adds the tool to the FastMCP server, delegating execution to the tool's `run` method.
    tools.forEach((tool) => {
      server.addTool({
        name: tool.name,
        description: tool.description,
        parameters: tool.parameters,
        execute: async (args) => {
          try {
            const result = await tool.run(args);
            return JSON.stringify(result, null, 2);
          } catch (error) {
            const handled = error instanceof ToolError ? error : new ToolError((error as Error).message);
            throw handled;
          }
        },
      });
    });
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 tool retrieves historical data, implying a read-only operation, but doesn't cover critical aspects like rate limits, error handling, data format, or whether it requires authentication. This leaves significant gaps for safe and effective use.

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 functionality without any wasted words. It directly communicates the tool's purpose, making it easy to parse and understand quickly.

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 financial data retrieval, no annotations, and no output schema, the description is insufficient. It lacks details on return format (e.g., OHLCV data), pagination, error cases, or authentication requirements, which are essential for an agent to use this tool correctly in a real-world 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 description mentions 'symbol and interval', which aligns with two of the three parameters (symbol, interval, limit). However, with 0% schema description coverage, it doesn't explain what values are valid (e.g., interval formats like '1m' or '1h'), the purpose of 'limit', or default behaviors. It adds minimal value beyond the schema's structure.

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 tool's purpose with a specific verb ('Get') and resource ('historical klines/candles'), and identifies the key parameters (symbol and interval). However, it doesn't explicitly differentiate from sibling tools like 'binance_market_price' or 'binance_market_exchangeInfo', which might also provide market data.

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. It doesn't mention scenarios like retrieving historical data for analysis versus real-time prices from 'binance_market_price', or prerequisites such as authentication needs, leaving the agent to infer usage from context 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/Valerio357/binance-mcp'

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