You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mcp.WithDescription("Get latest trading prices for a list of instruments"),
267
+
mcp.WithArray("instruments",
268
+
mcp.Description("Eg. ['NSE:INFY', 'NSE:SBIN']. This API returns the lastest price for the given list of instruments in the format of exchange:tradingsymbol."),
returnnil, errors.New("at least one instrument must be specified")
292
+
}
293
+
294
+
ltp, err:=kc.Kite.Client.GetLTP(instruments...)
295
+
iferr!=nil {
296
+
log.Println("error getting LTP", err)
297
+
returnnil, err
298
+
}
299
+
300
+
v, err:=json.Marshal(ltp)
301
+
iferr!=nil {
302
+
log.Println("error marshalling LTP data", err)
303
+
returnnil, err
304
+
}
305
+
306
+
ltpJSON:=string(v)
307
+
return&mcp.CallToolResult{
308
+
Content: []mcp.Content{
309
+
mcp.TextContent{
310
+
Type: "text",
311
+
Text: ltpJSON,
312
+
},
313
+
},
314
+
}, nil
315
+
}
316
+
}
317
+
318
+
typeOHLCToolstruct{}
319
+
320
+
func (*OHLCTool) Tool() mcp.Tool {
321
+
returnmcp.NewTool("get_ohlc",
322
+
mcp.WithDescription("Get OHLC (Open, High, Low, Close) data for a list of instruments"),
323
+
mcp.WithArray("instruments",
324
+
mcp.Description("Eg. ['NSE:INFY', 'NSE:SBIN']. This API returns OHLC data for the given list of instruments in the format of exchange:tradingsymbol."),
0 commit comments