Skip to main content
Glama

get_ohlc_data

Read-only

Get OHLCV (open, high, low, close, volume) data for a CSE symbol. Prices are adjusted for splits by default (clean price action), but NOT for rights issues or dividends, unless requested. Defaults to the most recent 50 trading days; if more history is available the response says so and how to page further back with offset. Returns CSV (date,open,high,low,close,volume) preceded by a note if the symbol was resolved from a name/typo, if the company has other instruments, or if any corporate actions (splits/rights/dividends) fall within the requested range. If the input is ambiguous, returns JSON candidates instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoEnd date in YYYY-MM-DD format
fromNoStart date in YYYY-MM-DD format
limitNoMax trading days to return, most recent first (before reversing to chronological order). Default 50, max 500.
offsetNoSkip this many of the most recent trading days before taking `limit` — use to page further back into history.
symbolYesA CSE ticker (e.g. "SAMP" or "SAMP.N0000") or the company name (e.g. "Sampath Bank"). Typos are tolerated. A bare symbol or name defaults to the voting-shares instrument if the company has more than one listed instrument (voting/non-voting/rights/debentures/preferential) — the response notes the others if so. If the input is ambiguous, the response returns candidates instead of data; ask the user to pick one and call again with the exact symbol.
intervalNoData intervaldaily
adjust_rightsNoAdjust historical prices for rights issues. Default false.
adjust_splitsNoAdjust historical prices for stock splits and scrip/bonus share dividends. Default true.
adjust_dividendsNoAdjust historical prices for cash dividends, producing a total-return series. Default false — turn this on when the user is asking about total return / performance rather than raw price action.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description adds substantial behavior beyond that: split adjustment by default (but not rights/dividends), 50-day default, paging disclosure, CSV return format preceded by resolution/corporate-action notes, and the JSON-candidates fallback for ambiguous input. This richly discloses behavior without contradicting the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single dense paragraph that front-loads the purpose and packs in adjustment defaults, paging, return format, and disambiguation behavior. Nearly every clause earns its place for a tool of this complexity; it is only slightly long, which is justified by the behavioral richness it conveys.

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

Completeness5/5

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

With no output schema, the description correctly shoulders the burden of explaining the return format (CSV with date,open,high,low,close,volume), the note-preceded behavior, paging, adjustments, and ambiguous-input fallback. The schema covers parameters; the description covers everything else an agent needs to call and interpret the tool correctly. Complete for a tool this complex.

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 baseline is 3. The schema already documents every parameter thoroughly, including the detailed symbol semantics and the when-to-enable guidance for adjust_dividends. The description adds a little framing ('clean price action', 'total-return series') and confirms defaults, but does not materially add meaning beyond the schema — the schema carries the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource: 'Get OHLCV (open, high, low, close, volume) data for a CSE symbol.' It distinguishes itself from siblings like get_index_data, get_macro_data, and get_technicals by scoping to CSE symbols with OHLCV, and clarifies the exchange. The purpose is unambiguous and differentiated.

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 gives clear operational context: defaults to the most recent 50 trading days, explains how paging back via offset works, and describes the disambiguation flow (returns JSON candidates when ambiguous). It does not explicitly name sibling alternatives or state when NOT to use this tool, which keeps it from a 5, but the usage guidance is concrete and actionable.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources