Skip to main content
Glama
jackdark425

Financial Modeling Prep (FMP) MCP Server

by jackdark425

get_analyst_estimates

Retrieve analyst financial estimates for stocks including revenue and EPS forecasts to support investment research and analysis.

Instructions

Get analyst financial estimates for a stock (revenue, EPS forecasts)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesStock ticker symbol
periodNoPeriod type (annual or quarter)
limitNoNumber of periods to return (default: 10)

Implementation Reference

  • The async handler function that executes the logic for 'get_analyst_estimates', fetching data from the FMP API.
    async (args: z.infer<typeof AnalystEstimatesSchema>) => {
      try {
        const period = args.period || 'annual';
        const limit = args.limit || 10;
        const data = await fetchFMP<AnalystEstimate[]>(
          `/analyst-estimates?symbol=${args.symbol.toUpperCase()}&period=${period}&limit=${limit}`
        );
        return jsonResponse(data);
      } catch (error) {
        return errorResponse(error);
      }
    }
  • The input validation schema (AnalystEstimatesSchema) for the 'get_analyst_estimates' tool.
    const AnalystEstimatesSchema = z.object({
      symbol: SymbolSchema.describe('Stock ticker symbol'),
      period: PeriodSchema.describe('Period type (annual or quarter)'),
      limit: LimitSchema.describe('Number of periods to return (default: 10)'),
    });
  • Registration of the 'get_analyst_estimates' tool within the server instance.
    server.registerTool(
      'get_analyst_estimates',
      {
        description: 'Get analyst financial estimates for a stock (revenue, EPS forecasts)',
        inputSchema: AnalystEstimatesSchema,
      },
      async (args: z.infer<typeof AnalystEstimatesSchema>) => {
        try {
          const period = args.period || 'annual';
          const limit = args.limit || 10;
          const data = await fetchFMP<AnalystEstimate[]>(
            `/analyst-estimates?symbol=${args.symbol.toUpperCase()}&period=${period}&limit=${limit}`
          );
          return jsonResponse(data);
        } catch (error) {
          return errorResponse(error);
        }
      }
    );

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