Skip to main content
Glama
matteoantoci

Marketstack MCP Server

by matteoantoci

get_splits_data

Retrieve stock splits data for specified ticker symbols, filtered by date range and sorted by preference. Use this tool to access detailed split information, including historical and recent splits, for up to 100 symbols per request.

Instructions

Look up information about the stock splits factor for different symbols.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
date_fromNoFilter results based on a specific timeframe by passing a from-date in `YYYY-MM-DD` format. You can also specify an exact time in ISO-8601 date format, e.g. `2020-05-21T00:00:00+0000`.
date_toNoFilter results based on a specific timeframe by passing an end-date in `YYYY-MM-DD` format. You can also specify an exact time in ISO-8601 date format, e.g. `2020-05-21T00:00:00+0000`.
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.
sortNoBy default, results are sorted by date/time descending. Use this parameter to specify a sorting order. Available values: `DESC` (Default), `ASC`.DESC
symbolsYesSpecify one or multiple comma-separated stock symbols (tickers) for your request, e.g. `AAPL` or `AAPL,MSFT`. Each symbol consumes one API request. Maximum: 100 symbols

Implementation Reference

  • The async handler function that processes the input parameters, constructs the API request for splits data, fetches from MarketstackClient, and returns the data or throws an error.
    const getSplitsDataHandler = async (input: Input, client: MarketstackClient): Promise<Output> => {
      try {
        const { symbols, sort, date_from, date_to, limit, offset } = input;
    
        const apiRequestParams: MarketstackApiParams = {
          endpoint: 'splits',
          symbols,
          ...(sort && { sort }), // Include if sort is provided
          ...(date_from && { date_from }), // Include if date_from is provided
          ...(date_to && { date_to }), // Include if date_to is provided
          ...(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('getSplitsData tool error:', error);
        const message = error instanceof Error ? error.message : 'An unknown error occurred.';
        throw new Error(`getSplitsData tool failed: ${message}`);
      }
    };
  • Zod schema definition for the input parameters of the get_splits_data tool, including symbols, sort order, date filters, pagination limit, and offset.
    const getSplitsDataInputSchemaShape = {
      symbols: z
        .string()
        .describe(
          'Specify one or multiple comma-separated stock symbols (tickers) for your request, e.g. `AAPL` or `AAPL,MSFT`. Each symbol consumes one API request. Maximum: 100 symbols'
        ),
      sort: z
        .enum(['DESC', 'ASC'])
        .optional()
        .default('DESC')
        .describe(
          'By default, results are sorted by date/time descending. Use this parameter to specify a sorting order. Available values: `DESC` (Default), `ASC`.'
        ),
      date_from: z
        .string()
        .optional()
        .describe(
          'Filter results based on a specific timeframe by passing a from-date in `YYYY-MM-DD` format. You can also specify an exact time in ISO-8601 date format, e.g. `2020-05-21T00:00:00+0000`.'
        ),
      date_to: z
        .string()
        .optional()
        .describe(
          'Filter results based on a specific timeframe by passing an end-date in `YYYY-MM-DD` format. You can also specify an exact time in ISO-8601 date format, e.g. `2020-05-21T00:00:00+0000`.'
        ),
      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 get_splits_data tool on the MCP server instance, linking to its name, description, schema, and wrapped handler function.
    server.tool(
      getSplitsDataTool.name,
      getSplitsDataTool.description,
      getSplitsDataTool.inputSchemaShape,
      wrapToolHandler((input) => getSplitsDataTool.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 the full burden of behavioral disclosure. While 'look up' implies a read-only operation, the description doesn't address critical behaviors like rate limits, authentication requirements, error handling, or response format. For a financial data tool with 6 parameters and no output schema, this leaves significant gaps in understanding how the tool behaves.

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 lookup tool and front-loads the essential information. Every word earns its place, making it easy for an agent to parse quickly.

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 (6 parameters, no annotations, no output schema), the description is insufficient. It doesn't explain what 'stock splits factor' means, what data format to expect, or how results are structured. For a financial data tool that likely returns time-series or tabular data, more context is needed to help the agent understand what information will be returned and how to interpret it.

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 description mentions 'different symbols' which aligns with the 'symbols' parameter, but adds no additional semantic context beyond what's already in the schema descriptions. With 100% schema description coverage, the baseline is 3—the schema does the heavy lifting by documenting all parameters thoroughly, so the description doesn't need to compensate but also doesn't add meaningful value.

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 tool's purpose as 'Look up information about the stock splits factor for different symbols,' which specifies the verb ('look up'), resource ('stock splits factor'), and target ('different symbols'). It distinguishes from siblings like 'get_dividends_data' or 'get_ticker_details' by focusing specifically on stock splits data rather than other financial metrics.

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, typical use cases, or comparisons with sibling tools like 'get_ticker_info' or 'get_end_of_day_data' that might also provide stock-related data. The agent must infer usage from the tool name and parameters alone.

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