Skip to main content
Glama
matteoantoci

Marketstack MCP Server

by matteoantoci

get_ticker_details

Retrieve detailed financial data for a specific ticker symbol, including exchange information, using the Marketstack MCP Server. Input the symbol to access comprehensive market insights.

Instructions

Obtain information about a specific ticker symbol.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exchangeNoTo filter your results based on a specific stock exchange, use this parameter to specify the MIC identification of a stock exchange. Example: `XNAS`
symbolYesObtain information about a specific ticker symbol by attach it to your API request URL, e.g. `AAPL`.

Implementation Reference

  • The asynchronous handler function that destructures input, builds the /tickers/{symbol} endpoint, optionally adds exchange param, fetches data via Marketstack client, and handles errors.
    const getTickerDetailsHandler = async (input: Input, client: MarketstackClient): Promise<Output> => {
      try {
        const { symbol, exchange } = input;
    
        // Construct the endpoint path with the symbol
        let endpoint = `tickers/${symbol}`;
    
        const apiRequestParams: MarketstackApiParams = {
          endpoint,
          ...(exchange && { exchange }), // Include if exchange is provided
        };
    
        const data = await client.fetchApiData(apiRequestParams);
    
        return data;
      } catch (error: unknown) {
        console.error('getTickerDetails tool error:', error);
        const message = error instanceof Error ? error.message : 'An unknown error occurred.';
        throw new Error(`getTickerDetails tool failed: ${message}`);
      }
    };
  • Zod input schema shape defining required 'symbol' string and optional 'exchange' string with descriptions.
    const getTickerDetailsInputSchemaShape = {
      symbol: z
        .string()
        .describe('Obtain information about a specific ticker symbol by attach it to your API request URL, e.g. `AAPL`.'),
      exchange: z
        .string()
        .optional()
        .describe(
          'To filter your results based on a specific stock exchange, use this parameter to specify the MIC identification of a stock exchange. Example: `XNAS`'
        ),
      // Note: The documentation mentions limit and offset for the /tickers endpoint, but it seems to apply
      // when listing multiple tickers, not getting details for a single one. We'll omit them for this tool.
    };
  • Registers the 'get_ticker_details' tool on the MCP server using its name, description, input schema, and a wrapped version of its handler that injects the Marketstack client.
    server.tool(
      getTickerDetailsTool.name,
      getTickerDetailsTool.description,
      getTickerDetailsTool.inputSchemaShape,
      wrapToolHandler((input) => getTickerDetailsTool.handler(input, client))
    );
  • Exports the tool definition object bundling the name, description, input schema shape, and handler function for use in registration.
    export const getTickerDetailsTool: MarketstackToolDefinition = {
      name: 'get_ticker_details',
      description: 'Obtain information about a specific ticker symbol.',
      inputSchemaShape: getTickerDetailsInputSchemaShape,
      handler: getTickerDetailsHandler,
    };
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. The description only states it 'obtains information' without specifying what kind of information, whether it's real-time or historical, what permissions might be needed, rate limits, or what the response format looks like. For a financial data tool with no annotation coverage, this is insufficient behavioral 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 extremely concise - a single sentence that gets straight to the point with zero wasted 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 the complexity of financial data tools and the lack of both annotations and output schema, the description is incomplete. It doesn't explain what information is returned, whether it's comprehensive ticker details versus specific data types, or how it differs from similar sibling tools. The agent would need to guess about the tool's behavior and output.

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 already fully documents both parameters (symbol and exchange). The description doesn't add any parameter semantics beyond what's in the schema - it mentions 'specific ticker symbol' which aligns with the schema but provides no additional context about parameter usage, constraints, or relationships.

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 action ('Obtain information') and target resource ('specific ticker symbol'), which is a specific verb+resource combination. However, it doesn't distinguish this tool from sibling tools like 'get_ticker_info' or 'get_end_of_day_data' - the description could be more specific about what type of ticker information this provides versus those alternatives.

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 about when to use this tool versus alternatives. With multiple sibling tools that appear to provide different types of financial data (get_ticker_info, get_end_of_day_data, get_intraday_data, etc.), there's no indication of what makes this tool distinct or when it should be chosen over those alternatives.

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