list_etf_tickers
Retrieve a list of supported ETF tickers with customizable pagination limits and offsets for precise API requests through the Marketstack MCP Server.
Instructions
List all supported ETF tickers.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Specify a pagination limit (number of results per page) for your API request. Default limit value is `100`, maximum allowed limit value is `1000`. | |
| list | Yes | Specify your list as ticker for your request. | |
| offset | No | Specify a pagination offset value for your API request. Example: An offset value of `100` combined with a limit value of 10 would show results 100-110. Default value is `0`, starting with the first available result. |
Implementation Reference
- The main handler function that executes the tool logic by constructing API parameters and calling the Marketstack client to fetch ETF tickers.const listEtfTickersHandler = async (input: Input, client: MarketstackClient): Promise<Output> => { try { const { list, limit, offset } = input; const apiRequestParams: MarketstackApiParams = { endpoint: 'etflist', list, ...(limit && { limit }), // Include if limit is provided ...(offset && { offset }), // Include if offset is provided }; const data = await client.fetchApiData(apiRequestParams); return data; } catch (error: unknown) { console.error('listEtfTickers tool error:', error); const message = error instanceof Error ? error.message : 'An unknown error occurred.'; throw new Error(`listEtfTickers tool failed: ${message}`); } };
- Zod input schema shape defining parameters for the list_etf_tickers tool: list (fixed to 'ticker'), optional limit, and offset.const listEtfTickersInputSchemaShape = { list: z.literal('ticker').describe('Specify your list as ticker for your request.'), limit: z .number() .int() .min(1) .max(1000) .optional() .default(100) .describe( 'Specify a pagination limit (number of results per page) for your API request. Default limit value is `100`, maximum allowed limit value is `1000`.' ), offset: z .number() .int() .min(0) .optional() .default(0) .describe( 'Specify a pagination offset value for your API request. Example: An offset value of `100` combined with a limit value of 10 would show results 100-110. Default value is `0`, starting with the first available result.' ), };
- src/tools/financialInstruments/index.ts:48-53 (registration)Registration of the list_etf_tickers tool on the MCP server using server.tool, wrapping the handler with the Marketstack client.server.tool( listEtfTickersTool.name, listEtfTickersTool.description, listEtfTickersTool.inputSchemaShape, wrapToolHandler((input) => listEtfTickersTool.handler(input, client)) );
- src/tools/financialInstruments/listEtfTickers.ts:62-67 (registration)Tool definition export that bundles name, description, schema, and handler for the list_etf_tickers tool.export const listEtfTickersTool: MarketstackToolDefinition = { name: 'list_etf_tickers', description: 'List all supported ETF tickers.', inputSchemaShape: listEtfTickersInputSchemaShape, handler: listEtfTickersHandler, };