Skip to main content
Glama

comtrade_get_data_availability

Read-onlyIdempotent

Check which UN Comtrade datasets cover a query per reporter and period, returning record counts and release dates. Validate availability and publication windows before requesting trade data.

Instructions

List the UN Comtrade datasets a query covers, per reporter and period, with release dates.

Upstream's getDa: which reporters have published data for which periods, in which classification, how many records each dataset holds and when it was first and last released (first_released, last_released, naive datetimes as upstream sends them). One call. A period nobody reported returns an empty list. Arguments are checked before the call; an unknown reporter code raises UnknownCode, an InvalidRequestError naming the packaged list and the closest area, another mistake InvalidRequestError naming the closest valid value.

Args: type_code: "C" goods or "S" services. freq_code: "A" annual or "M" monthly. cl_code: Classification: "HS" for the data as reported (Switzerland 2023 is an "H6" dataset), an HS edition "H0" to "H6", SITC "S1" to "S4", "BE", for services "EB", "EB02", "EB10". reporter_code: Reporters, comma-separated, as list_reporters lists them: "757" Switzerland, "842" USA, "276" Germany, "156" China, "757,842". Omit for every reporter (169 datasets for 2023, annual HS). period: Years "2023" or months "202305", comma-separated, e.g. "2021,2022,2023"; unlike get_data, more than 12 are accepted. published_date_from: Upstream's publishedDateFrom, a day "2024-01-01": datasets published from then on. A dataset revised in the range counts (Switzerland 2022, first released 2023-02-01, revised 2024-04-29, is in 2024). published_date_to: Upstream's publishedDateTo, a day "2024-12-31".

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "type_code": "<type_code>",
      "freq_code": "<freq_code>",
      "cl_code": "<cl_code>"
    },
    "name": "comtrade_get_data_availability"
  }
}

Input Schema

NameRequiredDescriptionDefault
periodNo
cl_codeYes
freq_codeYes
type_codeYes
reporter_codeNo
published_date_toNo
published_date_fromNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the read-only, idempotent annotations, the description discloses that one upstream call is made, an unreported period yields an empty list, and arguments are validated before the call with named error types. It also documents naive release datetimes and the non-obvious rule that a dataset revised within the publication-date range counts, providing substantial 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded and the labeled Args section makes a necessarily long definition navigable, with most examples clarifying valid invocation or unusual behavior. It is nevertheless dense, and the multi-clause validation-error sentence is awkward, while highly specific examples such as the 169-dataset count add some bulk.

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

Completeness5/5

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

Despite the absence of an output schema, the description gives a useful conceptual return contract: a list covering reporters, periods, classifications, record counts, and first/last release fields, including empty-result and datetime behavior. Together with comprehensive parameter and validation guidance, this is sufficient for correct selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and no enums, the Args section supplies nearly all necessary meaning itself. It covers all seven parameters with allowed codes, date and period formats, comma-separated multi-value syntax, examples, omission behavior for reporters, publication-date filtering semantics, and the higher period limit relative to get_data.

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 opening sentence gives a specific verb and resource: listing UN Comtrade dataset coverage by reporter and period, with release dates. The following details about classification, record counts, and first/last releases clarify that this is availability metadata, but the description does not explicitly contrast its overall role with sibling tools; its direct get_data contrast concerns only period limits.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The focus on published reporter/period/classification coverage provides clear context for checking data availability, and the reporter_code guidance points agents to list_reporters for valid inputs. There are no explicit when-not rules or routing to another tool for retrieving trade observations, and the get_data comparison only explains that this tool accepts more than 12 periods.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.