Skip to main content
Glama
jackdark425

Financial Modeling Prep (FMP) MCP Server

by jackdark425

get_key_metrics

Retrieve essential financial metrics like P/E ratio, ROE, and debt ratios for a stock to analyze its financial health and performance.

Instructions

Get key financial metrics (P/E, ROE, debt ratios, etc.)

Input Schema

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

Implementation Reference

  • The handler and registration for 'get_key_metrics' are located together within the 'registerFinancialsTools' function in 'src/tools/financials.ts'.
    server.registerTool(
      'get_key_metrics',
      {
        description: 'Get key financial metrics (P/E, ROE, debt ratios, etc.)',
        inputSchema: FinancialStatementSchema,
      },
      async (args: z.infer<typeof FinancialStatementSchema>) => {
        try {
          const period = args.period || 'annual';
          const limit = args.limit || 5;
          const data = await fetchFMP(
            `/key-metrics?symbol=${args.symbol.toUpperCase()}&period=${period}&limit=${limit}`
          );
          return jsonResponse(data);
        } catch (error) {
          return errorResponse(error);
        }
      }
    );
  • The schema used for the tool inputs.
    const FinancialStatementSchema = 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: 5)'),
    });

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