33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/groww_mcp/tools/option_chain_tools.rb', line 33
def call(server_context:, trading_symbol:, expiry_date:, exchange: "NSE")
client = server_context[:client]
result = client.option_chain(trading_symbol, expiry_date: expiry_date, exchange: exchange)
format_response(result)
rescue GrowwMcp::ForbiddenError
MCP::Tool::Response.new([{
type: "text",
text: "❌ Option Chain access denied. Requires Groww Live Data subscription (₹499 + GST/month). " \
"Subscribe at: Groww App → Settings → Trading APIs.",
}])
rescue GrowwMcp::ApiError => e
error_response(e)
end
|