Skip to main content
Glama

get_historical_candles

Fetch historical OHLCV candles for an Upstox instrument with interval or unit settings and date ranges to support charting, analysis, and backtesting.

Instructions

Get historical OHLCV candles (Upstox v3). Returns [timestamp, open, high, low, close, volume]. Use interval (legacy names) OR unit+interval_value. Units: minutes 1-300, hours 1-5, days/weeks/months 1. Max range per request: 1 month for minutes 1-15; 1 quarter for minutes >15 and hours; 1 decade for days. from_date is optional (defaults to to_date).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "instrument_key": "<instrument_key>",
      "to_date": "<to_date>"
    },
    "name": "get_historical_candles"
  }
}

Input Schema

NameRequiredDescriptionDefault
unitNo
to_dateYesYYYY-MM-DD
intervalNo
from_dateNoYYYY-MM-DD
instrument_keyYese.g. NSE_EQ|INE002A01018
interval_valueNowith unit: minutes 1-300, hours 1-5, others 1

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden: it discloses the return shape, the per-request range caps (a real constraint), and that from_date defaults to to_date. It omits whether an over-range request errors or truncates, whether pagination applies, and any auth/entitlement requirements for Upstox v3 — meaningful gaps for an unannotated tool.

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?

Extremely dense and front-loaded: return format first, then the parameter-selection rule, then the range limits that constrain valid calls. Every clause carries factual value with no filler, though the telegraphic style is terse.

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?

For a 6-parameter historical-data tool with no output schema and no annotations, the description covers return shape, parameter modes, allowed values, and date-range limits — enough to call it correctly. Residual gaps are error behavior on limit violations and auth requirements, which are minor relative to what is disclosed.

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

Parameters4/5

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

Schema coverage is 67%, and the description compensates well: it explains the mutually exclusive interval vs unit+interval_value modes, enumerates valid unit bounds (minutes 1-300, hours 1-5, others 1), and clarifies that from_date defaults to to_date — a default the schema does not state. Only instrument_key semantics are left to the schema alone.

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?

States a specific verb and resource ('Get historical OHLCV candles') plus the API version and the exact returned tuple, so the agent knows precisely what it produces. It implies 'historical' scope but does not name the sibling alternatives like get_intraday_candles or get_expired_historical_candles, so sibling differentiation is by name only.

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

Usage Guidelines3/5

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

Gives real operational rules — either `interval` or `unit`+`interval_value`, allowed unit ranges, and the max date range per granularity — which tell the agent how to call it legally. It never states when to prefer this over get_intraday_candles or get_expired_historical_candles, and doesn't say what happens if the range limit is exceeded.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.