Skip to main content
Glama

get_kline

Retrieve candlestick chart data for cryptocurrency trading analysis on Bybit. Specify symbol, time interval, and category to access historical price patterns for informed trading decisions.

Instructions

Get K-line (candlestick) data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYesCategory (spot, linear, inverse, etc.)
symbolYesSymbol (e.g., BTCUSDT)
intervalYesTime interval (1, 3, 5, 15, 30, 60, 120, 240, 360, 720, D, W, M)
startNoStart time in milliseconds
endNoEnd time in milliseconds
limitNoNumber of records to retrieve

Implementation Reference

  • Core handler function that executes the get_kline tool logic by making authenticated API request to Bybit's /v5/market/kline endpoint.
    async getKline(
      category: string,
      symbol: string,
      interval: string,
      start?: number,
      end?: number,
      limit: number = 200
    ): Promise<BybitResponse<KlineData> | { error: string }> {
      const params: any = { category, symbol, interval, limit };
      if (start) params.start = start;
      if (end) params.end = end;
      return this.makeBybitRequest('/v5/market/kline', 'GET', params);
    }
  • Input schema and registration for the get_kline tool in the MCP tools list.
      name: 'get_kline',
      description: 'Get K-line (candlestick) data',
      inputSchema: {
        type: 'object',
        properties: {
          category: {
            type: 'string',
            description: 'Category (spot, linear, inverse, etc.)',
          },
          symbol: {
            type: 'string',
            description: 'Symbol (e.g., BTCUSDT)',
          },
          interval: {
            type: 'string',
            description: 'Time interval (1, 3, 5, 15, 30, 60, 120, 240, 360, 720, D, W, M)',
          },
          start: {
            type: 'number',
            description: 'Start time in milliseconds',
          },
          end: {
            type: 'number',
            description: 'End time in milliseconds',
          },
          limit: {
            type: 'number',
            description: 'Number of records to retrieve',
            default: 200,
          },
        },
        required: ['category', 'symbol', 'interval'],
      },
    },
  • MCP CallToolRequest handler case that invokes the BybitService.getKline method and formats the response.
    case 'get_kline': {
      const result = await this.bybitService.getKline(
        typedArgs.category,
        typedArgs.symbol,
        typedArgs.interval,
        typedArgs.start,
        typedArgs.end,
        typedArgs.limit
      );
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • TypeScript interface defining the structure of Kline data returned by the Bybit API.
    export interface KlineData {
      symbol: string;
      category: string;
      list: [string, string, string, string, string, string, string][];
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but only states the action without behavioral details. It doesn't disclose if this is a read-only operation, rate limits, authentication needs, data freshness, or what happens with invalid parameters. The description adds no context beyond the basic action.

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 with zero waste. It's appropriately sized and front-loaded, though its brevity contributes to gaps in other dimensions. Every word 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?

For a tool with 6 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain return values (e.g., candlestick array format), error handling, or typical use cases. The agent lacks context to use this effectively beyond parameter passing.

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 parameters are well-documented in the schema. The description adds no meaning beyond what the schema provides (e.g., it doesn't explain K-line structure or how parameters interact). Baseline 3 is appropriate as the schema does the heavy lifting.

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 'Get K-line (candlestick) data' clearly states the verb ('Get') and resource ('K-line data'), but it's vague about scope and doesn't distinguish from siblings like get_tickers or get_orderbook. It lacks specificity about what exactly is retrieved (e.g., historical price 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?

No guidance is provided on when to use this tool versus alternatives like get_tickers (real-time prices) or get_orderbook (order depth). The description offers no context about use cases, prerequisites, or exclusions, leaving the agent to infer usage from parameter names 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/kondisettyravi/mcp-bybit-node'

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