get_technical_indicator_sma
Calculate Simple Moving Average (SMA) for stock analysis by providing symbol, timeframe, and period to identify price trends.
Instructions
Get Simple Moving Average (SMA) technical indicator
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | Stock ticker symbol | |
| timeframe | Yes | Timeframe for technical analysis | |
| period | No | Period length |
Implementation Reference
- src/tools/technical.ts:50-68 (handler)The handler and registration for 'get_technical_indicator_sma' are combined in the call to 'server.registerTool'.
// SMA server.registerTool( 'get_technical_indicator_sma', { description: 'Get Simple Moving Average (SMA) technical indicator', inputSchema: TechnicalIndicatorSchema, }, async (args: z.infer<typeof TechnicalIndicatorSchema>) => { try { const period = args.period || 10; const data = await fetchFMP<TechnicalIndicator[]>( `/technical-indicators/sma?symbol=${args.symbol.toUpperCase()}&timeframe=${args.timeframe}&periodLength=${period}` ); return jsonResponse(data); } catch (error) { return errorResponse(error); } } ); - src/tools/technical.ts:13-17 (schema)Input validation schema for 'get_technical_indicator_sma'.
const TechnicalIndicatorSchema = z.object({ symbol: z.string().describe('Stock ticker symbol'), timeframe: TimeframeSchema.describe('Timeframe for technical analysis'), period: z.number().optional().describe('Period length'), });