Skip to main content
Glama
jackdark425

Financial Modeling Prep (FMP) MCP Server

by jackdark425

get_earnings_calendar

Retrieve upcoming earnings announcement dates for companies to track financial reporting schedules and plan investment research.

Instructions

Get upcoming earnings announcements calendar

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromNoStart date in YYYY-MM-DD format (optional)
toNoEnd date in YYYY-MM-DD format (optional)

Implementation Reference

  • The async handler function that executes the logic for the get_earnings_calendar tool by fetching data from the FMP API.
    async (args: z.infer<typeof DateRangeSchema>) => {
      try {
        const params: string[] = [];
        if (args.from) params.push(`from=${args.from}`);
        if (args.to) params.push(`to=${args.to}`);
        const endpoint = '/earnings-calendar' + (params.length ? `?${params.join('&')}` : '');
        const data = await fetchFMP<EarningsCalendar[]>(endpoint);
        return jsonResponse(data);
      } catch (error) {
        return errorResponse(error);
      }
    }
  • Registration of the get_earnings_calendar tool within the server instance.
    // Earnings Calendar
    server.registerTool(
      'get_earnings_calendar',
      {
        description: 'Get upcoming earnings announcements calendar',
        inputSchema: DateRangeSchema,
      },
      async (args: z.infer<typeof DateRangeSchema>) => {
        try {
          const params: string[] = [];
          if (args.from) params.push(`from=${args.from}`);
          if (args.to) params.push(`to=${args.to}`);
          const endpoint = '/earnings-calendar' + (params.length ? `?${params.join('&')}` : '');
          const data = await fetchFMP<EarningsCalendar[]>(endpoint);
          return jsonResponse(data);
        } catch (error) {
          return errorResponse(error);
        }
      }
    );
  • Input schema definition for the get_earnings_calendar tool using Zod.
    const DateRangeSchema = z.object({
      from: z.string().optional().describe('Start date in YYYY-MM-DD format (optional)'),
      to: z.string().optional().describe('End date in YYYY-MM-DD format (optional)'),
    });

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