get_technical_indicator_rsi
Calculate the Relative Strength Index (RSI) to identify overbought or oversold stock conditions based on price momentum for informed trading decisions.
Instructions
Get Relative Strength Index (RSI) technical indicator
Input Schema
TableJSON 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:37-47 (handler)The handler function that performs the API call to fetch RSI technical indicator data.
async (args: z.infer<typeof TechnicalIndicatorSchema>) => { try { const period = args.period || 14; const data = await fetchFMP<TechnicalIndicator[]>( `/technical-indicators/rsi?symbol=${args.symbol.toUpperCase()}&timeframe=${args.timeframe}&periodLength=${period}` ); return jsonResponse(data); } catch (error) { return errorResponse(error); } } - src/tools/technical.ts:31-48 (registration)The registration of the 'get_technical_indicator_rsi' tool with the MCP server.
server.registerTool( 'get_technical_indicator_rsi', { description: 'Get Relative Strength Index (RSI) technical indicator', inputSchema: TechnicalIndicatorSchema, }, async (args: z.infer<typeof TechnicalIndicatorSchema>) => { try { const period = args.period || 14; const data = await fetchFMP<TechnicalIndicator[]>( `/technical-indicators/rsi?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 the technical indicator tools, including RSI.
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'), });