Skip to main content
Glama
matteoantoci

Marketstack MCP Server

by matteoantoci

get_index_info

Retrieve detailed information for a specific stock market index, such as Australia All Ordinaries, using the Marketstack MCP Server to access accurate financial market data.

Instructions

Get details for a specific stock market index.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexYesSpecify your benchmark/index id for your request, e.g. australia_all_ordinaries.

Implementation Reference

  • The main handler function that executes the tool logic by fetching index information from the Marketstack API using the provided index identifier.
    const getIndexInfoHandler = async (input: Input, client: MarketstackClient): Promise<Output> => {
      try {
        const { index } = input;
    
        const apiRequestParams: MarketstackApiParams = {
          endpoint: 'indexinfo',
          index,
        };
    
        const data = await client.fetchApiData(apiRequestParams);
    
        return data;
      } catch (error: unknown) {
        console.error('getIndexInfo tool error:', error);
        const message = error instanceof Error ? error.message : 'An unknown error occurred.';
        throw new Error(`getIndexInfo tool failed: ${message}`);
      }
    };
  • Zod input schema defining the required 'index' parameter for the tool.
    const getIndexInfoInputSchemaShape = {
      index: z.string().describe('Specify your benchmark/index id for your request, e.g. australia_all_ordinaries.'),
    };
  • MCP server registration of the 'get_index_info' tool, providing name, description, input schema, and wrapped handler.
    server.tool(
      getIndexInfoTool.name,
      getIndexInfoTool.description,
      getIndexInfoTool.inputSchemaShape,
      wrapToolHandler((input) => getIndexInfoTool.handler(input, client))
    );
  • Tool definition object that bundles the name, description, schema, and handler for use in registration.
    export const getIndexInfoTool: MarketstackToolDefinition = {
      name: 'get_index_info',
      description: 'Get details for a specific stock market index.',
      inputSchemaShape: getIndexInfoInputSchemaShape,
      handler: getIndexInfoHandler,
    };
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it 'gets details' but doesn't specify what details are returned (e.g., current value, components, performance), whether it's a read-only operation, or any limitations like rate limits or authentication needs. This leaves significant gaps for a tool with no annotation coverage.

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 unnecessary words. It is front-loaded and appropriately sized for a simple tool, with every part contributing essential information.

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?

Given the tool's complexity (simple read operation) but lack of annotations and output schema, the description is incomplete. It doesn't explain what details are returned, potential errors, or how it differs from similar tools. For a tool with no structured output information, more context is needed to guide effective use.

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 schema description coverage is 100%, with the parameter 'index' fully documented in the schema as 'Specify your benchmark/index id for your request, e.g. australia_all_ordinaries.' The description adds no additional meaning beyond this, such as format constraints or examples not in the schema, so it meets the baseline for high 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 'Get' and resource 'details for a specific stock market index', making the purpose understandable. It distinguishes from siblings like 'list_indices' (which lists indices) by focusing on details for a specific index, though it doesn't explicitly name alternatives. This is clear but lacks explicit sibling differentiation.

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. It doesn't mention prerequisites (e.g., needing an index ID from 'list_indices'), exclusions, or comparisons to siblings like 'get_ticker_details' for individual stocks. Usage is implied by the name but not explicitly stated.

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