fmp_financial
Retrieve financial statements (income, balance sheet, cash flow) for companies using stock ticker symbols to analyze financial performance.
Instructions
Get company financial statements (income statement, balance sheet, cash flow) from FMP.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | Stock ticker symbol | |
| statement | Yes | Type of financial statement | |
| period | No | Reporting period (default: annual) | |
| limit | No | Number of periods to return (default 5) |
Implementation Reference
- src/tools/fmp.ts:16-27 (registration)The "fmp_financial" tool is registered here in the fmpTools array, specifying its input schema and API endpoint.
{ name: "fmp_financial", description: "Get company financial statements (income statement, balance sheet, cash flow) from FMP.", inputSchema: z.object({ symbol: z.string().describe("Stock ticker symbol"), statement: z.enum(["income-statement", "balance-sheet-statement", "cash-flow-statement"]) .describe("Type of financial statement"), period: z.enum(["annual", "quarter"]).optional().describe("Reporting period (default: annual)"), limit: z.number().optional().describe("Number of periods to return (default 5)"), }), endpoint: "/v1/fmp/financial", }, - src/index.ts:14-39 (handler)The handler logic for "fmp_financial" (and all other tools in allTools) is dynamically registered in src/index.ts. It uses the `gatewayRequest` helper to fetch data from the API endpoint defined in the tool registration.
// Register all tools for (const tool of allTools) { server.tool( tool.name, tool.description, tool.inputSchema.shape, async (params) => { const method = tool.method || "POST"; const result = await gatewayRequest(method, tool.endpoint, params as Record<string, unknown>); if (result.error) { return { content: [{ type: "text" as const, text: `Error (${result.status}): ${result.error}` }], isError: true, }; } const text = typeof result.data === "string" ? result.data : JSON.stringify(result.data, null, 2); return { content: [{ type: "text" as const, text }], }; }, );