Summary
SDKIndexClient.getConstituents() exists in the domain layer (src/domain/market-data/client/typebb/index-client.ts) but is never registered as an AI-callable tool. The indexClient instance is already created in main.ts for the typebb-sdk backend but not wired into ToolCenter.
Change required
- Add
src/tool/index-data.ts — thin wrapper exposing indexGetConstituents:
export function createIndexTools(indexClient: IndexClientLike) {
return {
indexGetConstituents: tool({
description: 'Get constituents of a market index (e.g. S&P 500 via "^GSPC")',
inputSchema: z.object({
symbol: z.string(),
provider: z.string().optional(),
}),
execute: async ({ symbol, provider }) =>
indexClient.getConstituents({ symbol, ...(provider ? { provider } : {}) }),
}),
}
}
- Register in
main.ts after indexClient is instantiated:
if (indexClient) toolCenter.register(createIndexTools(indexClient), 'index')
Why
Needed as a prerequisite for any strategy that scans index universes (e.g. S&P 500 mean-reversion scans). Without this tool the AI cannot fetch constituent symbols at runtime.
Notes
- Only available when
marketData.backend === 'typebb-sdk' (the openbb-api path does not instantiate SDKIndexClient)
~15 LOC total, no new dependencies
Summary
SDKIndexClient.getConstituents()exists in the domain layer (src/domain/market-data/client/typebb/index-client.ts) but is never registered as an AI-callable tool. TheindexClientinstance is already created inmain.tsfor thetypebb-sdkbackend but not wired intoToolCenter.Change required
src/tool/index-data.ts— thin wrapper exposingindexGetConstituents:main.tsafterindexClientis instantiated:Why
Needed as a prerequisite for any strategy that scans index universes (e.g. S&P 500 mean-reversion scans). Without this tool the AI cannot fetch constituent symbols at runtime.
Notes
marketData.backend === 'typebb-sdk'(theopenbb-apipath does not instantiateSDKIndexClient)~15 LOCtotal, no new dependencies