189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
|
# File 'lib/groww_mcp/tools/market_tools.rb', line 189
def call(server_context:, trading_symbol:, start_time:, end_time:, exchange: "NSE", segment: "CASH",
interval_in_minutes: nil)
client = server_context[:client]
result = client.historical_candles(trading_symbol, start_time, end_time,
exchange: exchange, segment: segment,
interval_in_minutes: interval_in_minutes)
format_response(result)
rescue GrowwMcp::ForbiddenError
MCP::Tool::Response.new([{
type: "text",
text: "❌ Historical Data access denied. Requires Groww Live Data subscription (₹499 + GST/month).",
}])
rescue GrowwMcp::ApiError => e
error_response(e)
end
|