Skip to main content
Glama
matteoantoci

Marketstack MCP Server

by matteoantoci

get_exchange_details

Retrieve detailed information about a specific stock exchange using its MIC identifier. Ideal for accessing key financial market data through the Marketstack MCP Server.

Instructions

Obtain information about a specific stock exchange.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
micYesObtain information about a specific stock exchange by attaching its MIC identification to your API request URL, e.g. `XNAS`.

Implementation Reference

  • The async handler function that fetches exchange details for a given MIC using the Marketstack client by constructing the endpoint `exchanges/${mic}` and calling client.fetchApiData.
    const getExchangeDetailsHandler = async (input: Input, client: MarketstackClient): Promise<Output> => {
      try {
        const { mic } = input;
    
        // Construct the endpoint path with the MIC
        const endpoint = `exchanges/${mic}`;
    
        const apiRequestParams: MarketstackApiParams = {
          endpoint,
        };
    
        const data = await client.fetchApiData(apiRequestParams);
    
        return data;
      } catch (error: unknown) {
        console.error('getExchangeDetails tool error:', error);
        const message = error instanceof Error ? error.message : 'An unknown error occurred.';
        throw new Error(`getExchangeDetails tool failed: ${message}`);
      }
    };
  • Zod input schema shape defining the required 'mic' string parameter for the tool.
    const getExchangeDetailsInputSchemaShape = {
      mic: z
        .string()
        .describe(
          'Obtain information about a specific stock exchange by attaching its MIC identification to your API request URL, e.g. `XNAS`.'
        ),
    };
  • Registers the 'get_exchange_details' tool with the MCP server, providing name, description, input schema, and a wrapped handler function.
    server.tool(
      getExchangeDetailsTool.name,
      getExchangeDetailsTool.description,
      getExchangeDetailsTool.inputSchemaShape,
      wrapToolHandler((input) => getExchangeDetailsTool.handler(input, client))
    );
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'obtain information' implies a read-only operation, it doesn't specify authentication requirements, rate limits, error conditions, or what format/scope the information includes (e.g., trading hours, location, regulations). For a tool with no annotation coverage, this is insufficient.

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's appropriately sized for a simple lookup tool and front-loads the 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 no annotations, no output schema, and multiple sibling tools that could overlap in functionality, the description is incomplete. It doesn't explain what information is returned (e.g., exchange metadata vs. trading data), how it differs from other tools, or any behavioral constraints, leaving significant gaps for agent understanding.

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%, with the parameter 'mic' clearly documented in the schema as 'Obtain information about a specific stock exchange by attaching its MIC identification to your API request URL, e.g. `XNAS`.' The description adds no additional parameter semantics beyond what the schema already provides, meeting 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 'obtain' and resource 'information about a specific stock exchange', making the purpose understandable. However, it doesn't distinguish this tool from siblings like 'get_ticker_details' or 'get_index_info' that might also provide exchange-related information, preventing a perfect 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. With siblings like 'list_exchanges' (which might list exchanges) and 'get_ticker_details' (which might include exchange info), there's no indication of when this specific exchange-details tool is appropriate versus other options.

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