Skip to main content
Glama
jackdark425

Financial Modeling Prep (FMP) MCP Server

by jackdark425

get_income_statement

Retrieve company income statements for financial analysis. Specify stock symbol and period (annual/quarterly) to access revenue, expenses, and profitability data.

Instructions

Get company income statement (annual or quarterly)

Input Schema

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

Implementation Reference

  • The handler implementation for get_income_statement, which fetches income statement data from the FMP API using the provided symbol, period, and limit.
    server.registerTool(
      'get_income_statement',
      {
        description: 'Get company income statement (annual or quarterly)',
        inputSchema: FinancialStatementSchema,
      },
      async (args: z.infer<typeof FinancialStatementSchema>) => {
        try {
          const period = args.period || 'annual';
          const limit = args.limit || 5;
          const data = await fetchFMP<IncomeStatement[]>(
            `/income-statement?symbol=${args.symbol.toUpperCase()}&period=${period}&limit=${limit}`
          );
          return jsonResponse(data);
        } catch (error) {
          return errorResponse(error);
        }
      }
    );
  • The input schema definition used by get_income_statement.
    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)'),
    });
  • The registration function that defines the get_income_statement tool within the MCP server.
    export function registerFinancialsTools(server: any) {
      // Company Profile
      server.registerTool(
        'get_company_profile',
        {
          description: 'Get detailed company profile information including description, industry, sector, CEO, and more',
          inputSchema: CompanyProfileSchema,
        },
        async (args: z.infer<typeof CompanyProfileSchema>) => {
          try {
            const data = await fetchFMP<CompanyProfile[]>(`/profile?symbol=${args.symbol.toUpperCase()}`);
            return jsonResponse(data);
          } catch (error) {
            return errorResponse(error);
          }
        }
      );
    
      // Income Statement
      server.registerTool(
        'get_income_statement',
        {
          description: 'Get company income statement (annual or quarterly)',
          inputSchema: FinancialStatementSchema,
        },
        async (args: z.infer<typeof FinancialStatementSchema>) => {
          try {
            const period = args.period || 'annual';
            const limit = args.limit || 5;
            const data = await fetchFMP<IncomeStatement[]>(
              `/income-statement?symbol=${args.symbol.toUpperCase()}&period=${period}&limit=${limit}`
            );
            return jsonResponse(data);
          } catch (error) {
            return errorResponse(error);
          }
        }
      );
    
      // Balance Sheet
      server.registerTool(
        'get_balance_sheet',
        {
          description: 'Get company balance sheet statement (annual or quarterly)',
          inputSchema: FinancialStatementSchema,
        },
        async (args: z.infer<typeof FinancialStatementSchema>) => {
          try {
            const period = args.period || 'annual';
            const limit = args.limit || 5;
            const data = await fetchFMP<BalanceSheet[]>(
              `/balance-sheet-statement?symbol=${args.symbol.toUpperCase()}&period=${period}&limit=${limit}`
            );
            return jsonResponse(data);
          } catch (error) {
            return errorResponse(error);
          }
        }
      );
    
      // Cash Flow
      server.registerTool(
        'get_cash_flow',
        {
          description: 'Get company cash flow statement (annual or quarterly)',
          inputSchema: FinancialStatementSchema,
        },
        async (args: z.infer<typeof FinancialStatementSchema>) => {
          try {
            const period = args.period || 'annual';
            const limit = args.limit || 5;
            const data = await fetchFMP<CashFlow[]>(
              `/cash-flow-statement?symbol=${args.symbol.toUpperCase()}&period=${period}&limit=${limit}`
            );
            return jsonResponse(data);
          } catch (error) {
            return errorResponse(error);
          }
        }
      );
    
      // Stock News
      server.registerTool(
        'get_stock_news',
        {
          description: 'Get latest news articles for a stock symbol',
          inputSchema: StockNewsSchema,
        },
        async (args: z.infer<typeof StockNewsSchema>) => {
          try {
            const limit = args.limit || 10;
            const data = await fetchFMP(`/news/stock?symbols=${args.symbol.toUpperCase()}&limit=${limit}`);
            return jsonResponse(data);
          } catch (error) {
            return errorResponse(error);
          }
        }
      );
    
      // Key Metrics
      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);
          }
        }
      );
    
      // Financial Ratios
      server.registerTool(
        'get_financial_ratios',
        {
          description: 'Get detailed financial ratios (profitability, liquidity, efficiency)',
          inputSchema: FinancialStatementSchema,
        },
        async (args: z.infer<typeof FinancialStatementSchema>) => {
          try {
            const period = args.period || 'annual';
            const limit = args.limit || 5;
            const data = await fetchFMP(
              `/ratios?symbol=${args.symbol.toUpperCase()}&period=${period}&limit=${limit}`
            );
            return jsonResponse(data);
          } catch (error) {
            return errorResponse(error);
          }
        }
      );
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves data ('Get'), implying a read-only operation, but doesn't mention any behavioral traits like rate limits, authentication needs, data freshness, or what happens with invalid inputs. For a financial data tool with no annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, clearly stating the tool's purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of financial data retrieval, no annotations, and no output schema, the description is incomplete. It doesn't explain return values, error handling, or data format, leaving gaps for an AI agent to understand how to use the tool effectively in context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters (symbol, period, limit) with descriptions and enums. The description adds minimal value by implying period options ('annual or quarterly'), which is already covered in the schema. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get company income statement (annual or quarterly)'. It specifies the verb ('Get') and resource ('company income statement'), and distinguishes the period options. However, it doesn't explicitly differentiate from sibling tools like 'get_balance_sheet' or 'get_cash_flow', which are also financial statement tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_balance_sheet' or 'get_cash_flow' for other financial statements, nor does it specify prerequisites or contexts for choosing this tool over others in the server.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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