fmp_quote
Retrieve real-time and historical stock quotes for US and global markets using ticker symbols. Access current prices or historical data with date ranges.
Instructions
Get real-time and historical stock quotes from Financial Modeling Prep. Covers US and global markets.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | Stock ticker symbol (e.g., AAPL, MSFT, 005930.KS) | |
| historical | No | If true, return historical price data | |
| from | No | Historical start date (YYYY-MM-DD) | |
| to | No | Historical end date (YYYY-MM-DD) |
Implementation Reference
- src/tools/fmp.ts:5-15 (registration)The fmp_quote tool definition, which specifies the name, input schema, and API endpoint.
{ name: "fmp_quote", description: "Get real-time and historical stock quotes from Financial Modeling Prep. Covers US and global markets.", inputSchema: z.object({ symbol: z.string().describe("Stock ticker symbol (e.g., AAPL, MSFT, 005930.KS)"), historical: z.boolean().optional().describe("If true, return historical price data"), from: z.string().optional().describe("Historical start date (YYYY-MM-DD)"), to: z.string().optional().describe("Historical end date (YYYY-MM-DD)"), }), endpoint: "/v1/fmp/quote", }, - src/index.ts:14-40 (handler)The dynamic registration and handler logic for all tools, including fmp_quote. It routes the tool call to the gatewayRequest function based on the endpoint defined in the tool configuration.
// 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 }], }; }, ); }