getETFList
Retrieve a list of Exchange Traded Funds (ETFs) with their ticker symbols and company names. This tool simplifies identifying specific ETFs for financial analysis.
Instructions
Quickly find ticker symbols and company names for Exchange Traded Funds (ETFs) using the FMP ETF Symbol Search API. This tool simplifies identifying specific ETFs by their name or ticker.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/directory.ts:134-158 (handler)The MCP tool handler for 'getETFList'. Registers the tool with no input schema, calls directoryClient.getETFList(), and returns the result as JSON text.
server.tool( "getETFList", "Quickly find ticker symbols and company names for Exchange Traded Funds (ETFs) using the FMP ETF Symbol Search API. This tool simplifies identifying specific ETFs by their name or ticker.", {}, async () => { try { const results = await directoryClient.getETFList(); return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }], }; } catch (error) { return { content: [ { type: "text", text: `Error: ${ error instanceof Error ? error.message : String(error) }`, }, ], isError: true, }; } } ); - src/api/directory/types.ts:23-26 (schema)Type definition for ETF entries returned by getETFList. Contains symbol and name fields.
export interface ETFEntry { symbol: string; name: string; } - The DirectoryClient method that makes the actual HTTP GET request to the '/etf-list' endpoint to retrieve the list of ETFs.
async getETFList(options?: { signal?: AbortSignal; context?: FMPContext; }): Promise<ETFEntry[]> { return super.get<ETFEntry[]>("/etf-list", {}, options); } - src/tools/directory.ts:134-158 (registration)Registration of the 'getETFList' tool with the MCP server via server.tool(). Registered inside the registerDirectoryTools function.
server.tool( "getETFList", "Quickly find ticker symbols and company names for Exchange Traded Funds (ETFs) using the FMP ETF Symbol Search API. This tool simplifies identifying specific ETFs by their name or ticker.", {}, async () => { try { const results = await directoryClient.getETFList(); return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }], }; } catch (error) { return { content: [ { type: "text", text: `Error: ${ error instanceof Error ? error.message : String(error) }`, }, ], isError: true, }; } } );