Skip to main content
Glama

faostat_get_series

Read-onlyIdempotent

Retrieves yearly FAOSTAT series for a dataset across a chosen year range, filtering by area, item, element, and other dimensions.

Instructions

Get a FAOSTAT dataset's yearly series over a year range, filtered as get_data filters.

One get_data request with the years since to until as its filter: year, or for FS, which has year3, the codes of its year3 list whose middle year is in the range. With since and until it reads the dataset's structure first, and FS's year3 list, each kept for a day; a dataset with neither year nor year3 refuses them. Without either, every year comes. Give both or neither: one alone, or since after until, is refused before any request. Rows keep upstream's order, area, item, year ascending. Codes are checked and meta is built as get_data does, with since and until in meta.request; a range without a year of the dataset is refused. A call sends at most twelve requests (structure, year3 list, code lists, data, release date), each tried up to four times, 48 requests at most, a login where the process holds no token, and a login and the request again where FAOSTAT refuses with 401 or 403.

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": {
      "domain_code": "<domain_code>"
    },
    "name": "faostat_get_series"
  }
}

Input Schema

NameRequiredDescriptionDefault
areaNoThe area's code, FAO's, as ``list_codes(domain_code, "area")`` lists it, e.g. ``"231"`` (United States of America), or several, ``["231", "79"]``; ``None`` where the dataset has no area or every area is wanted.
itemNoThe item's code, as ``list_codes(domain_code, "item")`` lists it, e.g. ``"15"`` (Wheat), or several, ``["15", "56"]``; ``None`` likewise.
langNoLanguage of the labels and the headers: ``"en"`` (the default), ``"fr"`` or ``"es"``.en
sinceNoThe first year, included, e.g. ``2015``; with ``until``. ``None`` with ``until`` ``None`` asks for every year the domain holds.
untilNoThe last year, included, e.g. ``2021``; with ``since``. ``list_domains`` prints each domain's latest year as ``year_current`` (``"2024"`` for QCL in its recording).
elementNoThe element's filter code, as ``list_codes(domain_code, "element")`` lists it, e.g. ``"2510"`` (Production Quantity in QCL), which answers rows whose ``element_code`` is ``"5510"`` (Production); ``5510`` is refused naming ``2510``. Or several, ``["2510", "2312"]``; ``None`` likewise.
filtersNoAny other dimension's codes by its id, as ``get_data`` takes them, e.g. ``{"reporterarea": "231", "partnerarea": "110"}`` for TM; ``year``, ``year3``, ``since`` and ``until`` are refused, the years being ``since`` and ``until``'s.
domain_codeYesThe domain's code, as ``list_domains`` lists it, e.g. ``"QCL"`` (Crops and livestock products), ``"PP"`` (Producer Prices) or ``"FS"`` (Suite of Food Security Indicators); one FAOSTAT does not have raises ``NotFoundError``, and an empty text, ``"."`` or ``".."`` is refused before sending.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A3.9/5.0
Behavior5/5

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

Well beyond the readOnly/openWorld/idempotent annotations, the description discloses caching ('each kept for a day'), row ordering (area, item, year ascending), pre-request refusal conditions, and a precise request budget (12 requests per call, 4 attempts each, 48 max) plus login and 401/403 re-login retry behavior. This is unusually rich operational context that annotations cannot convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

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

The content mostly earns its place, but it is a single dense paragraph with run-on constructions ('One get_data request with the years since to until as its filter: year, or for FS, which has year3, the codes of its year3 list whose middle year is in the range'). Operational details could be separated from the core purpose for faster scanning.

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

Completeness4/5

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

For an 8-parameter tool with full schema coverage and no output schema, the description covers filters, year handling, refusals, auth, retries, and ordering. The main gap is return shape — it only says meta is built 'as get_data does', relying on the sibling rather than describing rows directly.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds genuine cross-parameter semantics: since and until must be supplied together, since after until is refused before any request, and a range with no matching year is refused. It also explains the FS year3 special case that the schema only gestures at.

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 names a specific verb and resource — get a FAOSTAT dataset's yearly series over a year range — and frames it as equivalent to get_data's filtering but scoped to years. That differentiates it from the general faostat_get_data, though the distinction is stated by analogy ('filtered as get_data filters') rather than spelled out.

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

Usage Guidelines3/5

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

Usage is implied rather than prescribed: the agent can infer this is the year-range wrapper around get_data, and the both-or-neither rule for since/until is stated. However, it never explicitly says when to prefer this over faostat_get_data or faostat_count_data, leaving the selection to inference.

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