Skip to main content
Glama
jackdark425

Financial Modeling Prep (FMP) MCP Server

by jackdark425

get_economic_indicator

Retrieve economic indicator data like GDP, unemployment, and inflation for financial analysis and market tracking using date ranges.

Instructions

Get economic indicator data (GDP, unemployment, inflation, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesIndicator name (e.g., GDP, unemploymentRate, CPI)
fromNoStart date in YYYY-MM-DD format (optional)
toNoEnd date in YYYY-MM-DD format (optional)

Implementation Reference

  • The handler function for 'get_economic_indicator' that fetches economic indicator data from the FMP API.
      async (args: z.infer<typeof EconomicIndicatorSchema>) => {
        try {
          let endpoint = `/economic-indicators?name=${args.name}`;
          if (args.from) endpoint += `&from=${args.from}`;
          if (args.to) endpoint += `&to=${args.to}`;
          const data = await fetchFMP(endpoint);
          return jsonResponse(data);
        } catch (error) {
          return errorResponse(error);
        }
      }
    );
  • Registration of the 'get_economic_indicator' tool with the server.
    server.registerTool(
      'get_economic_indicator',
      {
        description: 'Get economic indicator data (GDP, unemployment, inflation, etc.)',
        inputSchema: EconomicIndicatorSchema,
      },
      async (args: z.infer<typeof EconomicIndicatorSchema>) => {
        try {
          let endpoint = `/economic-indicators?name=${args.name}`;
          if (args.from) endpoint += `&from=${args.from}`;
          if (args.to) endpoint += `&to=${args.to}`;
          const data = await fetchFMP(endpoint);
          return jsonResponse(data);
        } catch (error) {
          return errorResponse(error);
        }
      }
    );
  • Input schema definition for the 'get_economic_indicator' tool.
    const EconomicIndicatorSchema = z.object({
      name: z.string().describe('Indicator name (e.g., GDP, unemploymentRate, CPI)'),
      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