Skip to main content
Glama
matteoantoci

Marketstack MCP Server

by matteoantoci

list_exchange_tickers

Retrieve all available tickers for a specific financial exchange by providing its MIC code. Supports pagination with customizable limit and offset for efficient data handling.

Instructions

Obtain all available tickers for a specific exchange.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoSpecify a pagination limit (number of results per page) for your API request. Default limit value is `100`, maximum allowed limit value is `1000`.
micYesObtain all available tickers for a specific exchange by attaching the exchange MIC, e.g. `XNAS`.
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.

Implementation Reference

  • Handler function that executes the tool logic: fetches exchange tickers using MarketstackClient with parameters mic, limit, offset.
    const listExchangeTickersHandler = async (input: Input, client: MarketstackClient): Promise<Output> => {
      try {
        const { mic, limit, offset } = input;
    
        // Construct the endpoint path with the MIC and /tickers
        const endpoint = `exchanges/${mic}/tickers`;
    
        const apiRequestParams: MarketstackApiParams = {
          endpoint,
          ...(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('listExchangeTickers tool error:', error);
        const message = error instanceof Error ? error.message : 'An unknown error occurred.';
        throw new Error(`listExchangeTickers tool failed: ${message}`);
      }
    };
  • Zod input schema shape defining parameters: mic (required string), limit and offset (optional numbers).
    const listExchangeTickersInputSchemaShape = {
      mic: z
        .string()
        .describe('Obtain all available tickers for a specific exchange by attaching the exchange MIC, e.g. `XNAS`.'),
      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 exporting the tool name, description, schema, and handler.
    export const listExchangeTickersTool: MarketstackToolDefinition = {
      name: 'list_exchange_tickers',
      description: 'Obtain all available tickers for a specific exchange.',
      inputSchemaShape: listExchangeTickersInputSchemaShape,
      handler: listExchangeTickersHandler,
    };
  • MCP server registration of the tool using server.tool() with wrapped handler.
    server.tool(
      listExchangeTickersTool.name,
      listExchangeTickersTool.description,
      listExchangeTickersTool.inputSchemaShape,
      wrapToolHandler((input) => listExchangeTickersTool.handler(input, client))
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action 'obtain' but doesn't mention whether this is a read-only operation, if it requires authentication, rate limits, or what the return format looks like (e.g., paginated list). This leaves significant gaps in understanding how the tool behaves beyond its basic function.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any redundant information. It's front-loaded and wastes no words, making it highly concise and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on behavioral traits, usage context, and output format. Without annotations or an output schema, more completeness would be needed for optimal agent guidance, but it meets the minimum viable threshold.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, providing detailed documentation for all three parameters (mic, limit, offset). The description adds no additional parameter semantics beyond what's in the schema, such as explaining the mic format further or clarifying pagination behavior. With high schema coverage, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'obtain' and resource 'all available tickers for a specific exchange', making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'list_tickers' or 'list_etf_tickers', which might have overlapping functionality, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'list_tickers' or 'list_etf_tickers'. It mentions a specific exchange but doesn't clarify prerequisites, exclusions, or comparative contexts with sibling tools, leaving usage decisions unclear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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