Skip to main content
Glama

Get Candles

get_candles
Read-onlyIdempotent

Retrieve OHLCV candle data for any ticker. Use outputPath to fetch full history beyond the 1000-bar limit via chunked requests.

Instructions

OHLCV candles. timeFrame: M1/M5/M15/M30/H1/H4/D/W/MN. The API caps one request at 1000 bars; inline calls return the most recent ~1000 TRADING bars of the range (truncated flag set when the range was not fully covered). Pass outputPath to fetch the FULL period via chunked requests (streamed to disk, deduplicated, with progress). Bond prices are quoted in % of face value, not currency.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoEnd, ISO 8601 (default: now)
fromNoStart, ISO 8601 (default: 30 days ago)
tickerYesTicker, e.g. SBER
classCodeNoBoard class code (resolved via find_instrument when omitted)
timeFrameNoD
outputPathNoWrite the full result to this file (path relative to the output root: BCS_OUTPUT_DIR or server cwd) instead of returning it inline. The response becomes a short summary {savedTo, records, bytes, sample}. Use for bulk data to keep the context clean. For get_candles this also enables full-history fetching (chunking beyond the 1000-bar API limit).
outputFormatNoFile format; default json (or csv if outputPath ends with .csv). csv writes the main flat array of the response.
Behavior5/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and destructiveHint false, indicating safe, read-only, and predictable behavior. The description adds valuable behavioral details: the 1000-bar API cap, inline returning most recent trading bars with a truncated flag, and outputPath enabling full-history chunking with deduplication and progress. This significantly enhances transparency beyond annotations.

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 three sentences, front-loaded with 'OHLCV candles.' It efficiently covers key aspects without redundancy, earning its place with each sentence.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (7 parameters, no output schema), the description covers core behaviors: inline/full modes, timeframes, bond pricing. It omits the classCode resolution detail, but that is covered in the schema. Overall, it provides sufficient context for selection and use.

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

Parameters5/5

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

Schema coverage is 86% (6 of 7 parameters described). The description adds meaning by enumerating valid timeFrame values, explaining the inline vs outputPath behavior, and noting bond price quoting. For example, the timeFrame enum values are listed and the outputPath param's full-history capability is explained, which goes beyond the schema's description.

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 'OHLCV candles' and lists supported timeframes, making the tool's purpose explicit. However, it does not explicitly differentiate from sibling tools like get_quotes or get_recent_trades, though the context of 'candles' versus 'quotes' provides implicit distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains two usage modes: inline for up to 1000 bars and with outputPath for full history, guiding when to use each. It also notes bond price quoting. However, it does not explicitly state when to prefer this tool over alternatives like get_quotes.

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/human-turn/bcs-mcp'

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