Skip to main content
Glama

Marketstack MCP Server

by matteoantoci

list_tickers

Retrieve a full list of supported stock tickers by searching name, symbol, or exchange mic, with options to paginate results for efficient data access.

Instructions

Get the full list of supported tickers.

Input Schema

NameRequiredDescriptionDefault
exchangeNoUse this parameter to search stock tickers by the exchange mic.
limitNoSpecify a pagination limit (number of results per page) for your API request. Default limit value is `100`, maximum allowed limit value is `1000`.
offsetNoSpecify 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.
searchNoUse this parameter to search stock tickers by name or ticker symbol.

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "exchange": { "description": "Use this parameter to search stock tickers by the exchange mic.", "type": "string" }, "limit": { "default": 100, "description": "Specify a pagination limit (number of results per page) for your API request. Default limit value is `100`, maximum allowed limit value is `1000`.", "maximum": 1000, "minimum": 1, "type": "integer" }, "offset": { "default": 0, "description": "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.", "minimum": 0, "type": "integer" }, "search": { "description": "Use this parameter to search stock tickers by name or ticker symbol.", "type": "string" } }, "type": "object" }

Implementation Reference

  • Implementation of the list_tickers tool handler function, which constructs API parameters and fetches ticker list data from the Marketstack API.
    const listTickersHandler = async (input: Input, client: MarketstackClient): Promise<Output> => { try { const { search, exchange, limit, offset } = input; const apiRequestParams: MarketstackApiParams = { endpoint: 'tickerslist', ...(search && { search }), // Include if search is provided ...(exchange && { exchange }), // Include if exchange is provided ...(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('listTickers tool error:', error); const message = error instanceof Error ? error.message : 'An unknown error occurred.'; throw new Error(`listTickers tool failed: ${message}`); } };
  • Zod input schema shape defining optional parameters for the list_tickers tool: search, exchange, limit, and offset.
    const listTickersInputSchemaShape = { search: z.string().optional().describe('Use this parameter to search stock tickers by name or ticker symbol.'), exchange: z.string().optional().describe('Use this parameter to search stock tickers by the exchange mic.'), 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.' ), };
  • Tool definition object that exports the list_tickers tool configuration including name, description, input schema, and handler reference.
    export const listTickersTool: MarketstackToolDefinition = { name: 'list_tickers', description: 'Get the full list of supported tickers.', inputSchemaShape: listTickersInputSchemaShape, handler: listTickersHandler, };
  • MCP server registration of the list_tickers tool using server.tool() with wrapped handler.
    server.tool( listTickersTool.name, listTickersTool.description, listTickersTool.inputSchemaShape, wrapToolHandler((input) => listTickersTool.handler(input, client)) );

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/matteoantoci/mcp-marketstack'

If you have feedback or need assistance with the MCP directory API, please join our Discord server