Skip to main content
Glama
jackdark425

Financial Modeling Prep (FMP) MCP Server

by jackdark425

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

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesStock ticker symbol
timeframeYesTimeframe for technical analysis
periodNoPeriod length

Implementation Reference

  • 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);
        }
      }
    );
  • 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'),
    });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jackdark425/aigroup-fmp-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server