Skip to main content
Glama
darved2305

groww-mcp

by darved2305

get_ohlc_data

Retrieve OHLC (Open, High, Low, Close) price data for stocks with customizable time intervals to analyze market trends and inform investment decisions.

Instructions

OHLC candles for a symbol — supports 1d/1w/1m/1y intervals

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesStock symbol
exchangeNoExchangeNSE
intervalNoCandle interval1d

Implementation Reference

  • The handler and tool registration for 'get_ohlc_data'. It fetches OHLC data using growwClient.getOHLC and formats it into a text response for the MCP client.
    // ── get_ohlc_data ─────────────────────────────────────────
    server.tool(
      "get_ohlc_data",
      "OHLC candles for a symbol — supports 1d/1w/1m/1y intervals",
      {
        symbol: z.string().describe("Stock symbol"),
        exchange: z.enum(["NSE", "BSE"]).default("NSE").describe("Exchange"),
        interval: z.enum(["1d", "1w", "1m", "1y"]).default("1d").describe("Candle interval"),
      },
      async ({ symbol, exchange, interval }) => {
        try {
          const sym = normalizeSymbol(symbol);
          const candles = await growwClient.getOHLC(sym, exchange, interval);
          if (candles.length === 0) return mcpText(`📭 No OHLC data for ${sym}`);
    
          const header = `📊 ${sym}.${exchange} — OHLC (${interval})\n${"─".repeat(55)}\n${"Date".padEnd(12)} ${"Open".padStart(10)} ${"High".padStart(10)} ${"Low".padStart(10)} ${"Close".padStart(10)} ${"Vol".padStart(8)}`;
    
          const rows = candles.slice(-15).map((c) => {
            const d = c.timestamp.substring(0, 10);
            return `${d.padEnd(12)} ${c.open.toFixed(2).padStart(10)} ${c.high.toFixed(2).padStart(10)} ${c.low.toFixed(2).padStart(10)} ${c.close.toFixed(2).padStart(10)} ${formatVolume(c.volume).padStart(8)}`;
          });
    
          const note = candles.length > 15 ? `\n(showing last 15 of ${candles.length} candles)` : "";
          return mcpText([header, ...rows, note].join("\n"));
        } catch (err) {
          return mcpError(normalizeError(err));
        }
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. While it mentions what data is returned (OHLC candles) and supported intervals, it doesn't address critical behavioral aspects like rate limits, authentication requirements, data freshness, pagination, error conditions, or whether this is a real-time or historical data source. For a financial data tool with no annotation coverage, this represents significant gaps.

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 extremely concise with zero wasted words. It front-loads the core functionality (OHLC candles for a symbol) and efficiently lists the supported intervals. Every element serves a purpose, making it easy to scan 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 lack of annotations and output schema, the description is incomplete for a financial data retrieval tool. It doesn't explain what format the OHLC data returns, whether it includes timestamps, volume information, or how many periods are returned. For a tool with 3 parameters in a domain where data format matters significantly, more contextual information would be expected.

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?

With 100% schema description coverage, the schema already documents all three parameters thoroughly. The description adds minimal value beyond the schema by mentioning interval support, but doesn't provide additional context about parameter interactions, validation rules, or usage examples. The baseline score of 3 reflects adequate but not enhanced parameter documentation.

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 retrieves OHLC candles for a symbol with specific interval support. It uses specific terms like 'OHLC candles' and 'symbol' with enumerated intervals, making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like get_quote or get_top_movers, which 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. With multiple sibling tools for market data (get_quote, get_top_movers, get_market_status), there's no indication of when OHLC data is preferred over simple quotes or other market information. No prerequisites, exclusions, or comparison context is mentioned.

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/darved2305/groww-mcp'

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