Skip to main content
Glama
matteoantoci

Marketstack MCP Server

by matteoantoci

list_indices

Retrieve and paginate through all supported stock market indices using limit and offset parameters for precise data access via the Marketstack API.

Instructions

List all supported stock market indices.

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`.
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

  • The handler function that executes the list_indices tool logic, fetching indices data from the Marketstack API using provided limit and offset parameters.
    const listIndicesHandler = async (input: Input, client: MarketstackClient): Promise<Output> => {
      try {
        const { limit, offset } = input;
    
        // Assuming the endpoint for listing indices is 'index' or 'indices'
        // The documentation is slightly ambiguous, using 'indexinfo' for details
        // and showing a listing response structure without a clear endpoint path.
        // We'll try 'index' first based on the 'indexinfo' example.
        const endpoint = 'index';
    
        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('listIndices tool error:', error);
        const message = error instanceof Error ? error.message : 'An unknown error occurred.';
        throw new Error(`listIndices tool failed: ${message}`);
      }
    };
  • Zod schema shape defining the input parameters (limit and offset) for the list_indices tool.
    const listIndicesInputSchemaShape = {
      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.'
        ),
    };
  • Registration of the list_indices tool with the MCP server using server.tool().
    server.tool(
      listIndicesTool.name,
      listIndicesTool.description,
      listIndicesTool.inputSchemaShape,
      wrapToolHandler((input) => listIndicesTool.handler(input, client))
    );
  • Tool definition object that bundles name, description, schema, and handler for list_indices.
    export const listIndicesTool: MarketstackToolDefinition = {
      name: 'list_indices',
      description: 'List all supported stock market indices.',
      inputSchemaShape: listIndicesInputSchemaShape,
      handler: listIndicesHandler,
    };
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'List' implies a read operation, it doesn't mention pagination behavior (though the schema covers parameters), rate limits, authentication requirements, or what format the results will be in. The description is minimal and lacks important operational context.

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 states exactly what the tool does without any wasted words. It's appropriately sized for a simple listing tool and gets straight to the point.

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

Completeness2/5

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

For a tool with no annotations and no output schema, the description is insufficient. It doesn't explain what information will be returned about each index, whether results are sorted, if there are any filtering options beyond pagination, or how this tool relates to other index-related tools in the server.

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?

Schema description coverage is 100%, so the schema fully documents both parameters (limit and offset) with their purposes, defaults, and constraints. The description adds no parameter information beyond what's in the schema, which is acceptable given the comprehensive schema coverage.

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 ('List') and resource ('all supported stock market indices'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'list_exchanges' or 'list_tickers' beyond specifying 'indices' as the resource type.

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 'get_index_info' (which presumably provides detailed information about a specific index) or other listing tools. There's no mention of prerequisites, typical use cases, or comparison with sibling tools.

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