Skip to main content
Glama

ilostat-mcp-server

Query ILOSTAT observations

ilostat_query_indicator
Read-onlyIdempotent

Fetch observations for up to 3 ILOSTAT datasets per call, filtered by reference area or area group, sex, breakdown codes (classif1, classif2), source, and period; datasets past the first 3 come back as remaining_dataset_ids for another call. Rows keep their source, observation status, decoded notes, and a basis — reported, modelled_estimate, or projection — and the response echoes every filter applied, including the best-source default. Codes are checked against ILOSTAT's dictionaries before the request is sent: ilostat_list_reference lists valid codes and ilostat_describe_indicator lists the codes a dataset actually uses. Rows come back limit at a time from offset, and next_offset continues the same request; on the first page, a result past the staging threshold is also staged in full as a df_ dataframe for SQL through ilostat_dataframe_describe and ilostat_dataframe_query when this deployment enables dataframes. A request with no filters at all is refused when the dataset exceeds the row ceiling; a filtered result past the ceiling is paged but not staged, and a page reaching past the ceiling is refused with guidance to narrow the request.

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": {
      "dataset_ids": "<dataset_ids>"
    },
    "name": "ilostat_query_indicator"
  }
}

Input Schema

NameRequiredDescriptionDefault
sexNoSex codes SEX_T, SEX_M, SEX_F, SEX_O; T/M/F/O and total/both/male/female/other are accepted.
timeNoOne exact period: YYYY (on a quarterly or monthly dataset, every period of that year), YYYYQn, or YYYYMmm; 2024-Q2, 2024 Q2, and 2025-03 are normalized. Not combinable with time_from, time_to, or latest_only.
limitNoRows per page, at most 5,000; a larger value is applied as 5,000 and the notice says so.
offsetNoRows to skip: 0 for the first page, else the previous page's next_offset, with the same other arguments. Each page re-reads the request upstream; under latest_only, combine pages only when their applied_filters.latest_mode matches.
sourcesNoSource codes (e.g. BA:453); ilostat_list_reference topic sources with ref_area lists an area's sources. Without source_selection, setting sources switches it to all, since a secondary source matches nothing under best.
time_toNoLast year (YYYY), not before time_from.
classif1NoCodes of the first breakdown (e.g. AGE_YTHADULT_YGE15); case-insensitive. ilostat_describe_indicator lists the codes a dataset uses.
classif2NoCodes of the second breakdown, for datasets that have one; case-insensitive. ilostat_describe_indicator lists them.
ref_areasNoReference areas (up to 300): ISO3 country codes (USA) or X-coded aggregates (X01 World); case-insensitive, ILO_GEO_ forms accepted. Aggregates need a dataset with has_aggregates true. Omit for every area.
time_fromNoFirst year (YYYY); upstream filters by year only.
area_groupNoX01 for every country, an ILO region or subregion, or a World Bank income group (X06, X56, X02, …); expands to its member countries, unioned with ref_areas. ilostat_list_reference topic area_groups lists the codes.
dataset_idsYesDataset IDs, up to 100 — an indicator code plus _A, _Q, or _M (UNE_DEAP_SEX_AGE_RT_A), as ilostat_search_indicators returns them. Case-insensitive; a DF_ prefix (the SDMX dataflow form) is stripped, a bare indicator code resolves when it has one frequency, an element holding + or , joined IDs is split, and duplicates are dropped. Every ID is checked; the first 3 distinct datasets are queried and the rest come back as remaining_dataset_ids for another call.
latest_onlyNoOnly each series' latest period — a series is one dataset, reference area, sex, classif1, and classif2 code — with every row at that period (one per source under source_selection all or secondary; the latest quarter or month on sub-annual datasets); combines with time_from/time_to. When the request's full history is too large or too slow to read in one call, it falls back to the latest period per area and dataset, which can miss a series that ends earlier; applied_filters.latest_mode says which ran, and the notice says so. time_from or classif1 narrow it back under; sex or fewer ref_areas alone may still read too much and fall back.
source_selectionNobest (default): the preferred source per area and period; all: secondary sources too, each row flagged best_source; secondary: secondary sources only. Defaults to all when sources is set.

Output Schema

NameRequiredDescriptionDefault
capNoThe limit applied to this page.
rowsNoThis page: at most limit rows from offset, in upstream's order (under per-series latest_only, each series' latest rows, series in the order first seen). A staged dataframe holds every row.
errorNoPresent when the call failed. Absent on success.
shownNoRows returned inline.
legendNoLabels for every code in rows.
noticeNoA limit past the page cap applied as the cap, datasets left for another call, a latest_only fallback to the latest period per area and dataset, filters that could not narrow a dataset, a unit the catalog does not list, the requested areas that returned no rows and why, why nothing matched, where the full result is staged, which rows the page holds and how to reach the next, or why a first page whose result passes the staging threshold was not staged (dataframes off, staging failed, or the result passes the row ceiling).
summaryNoSummary over every row read, not just the page.
datasetsNoThe queried datasets, in request order.
dataframeNoThe staged dataframe holding the full result; present only when staged.
row_countNoRows in the result — exact when summary.complete is true; otherwise the rows read before reading stopped past this page, which the result holds at least.
truncatedNoTrue when rows remain past this page; next_offset continues.
attributionNoCitation to keep with any use of the data.
next_offsetNoOffset of the next page, set when rows remain past this one; pass it as offset with the same other arguments.
applied_filtersNoEvery parameter sent upstream, defaults included.
remaining_dataset_idsNoRequested datasets past the first 3, as canonical IDs in request order; not fetched in this call. Pass them as dataset_ids with the same filters to get them. Absent when every requested dataset was queried.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed14 schema fields changed
    • addedInput schema / properties / limit
      Added value: +{
      +  "default": 50,
      +  "description": "Rows per page, at most 5,000; a larger value is applied as 5,000 and the notice says so.",
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "default": 0,
      +  "description": "Rows to skip: 0 for the first page, else the previous page's next_offset, with the same other arguments. Each page re-reads the request upstream; under latest_only, combine pages only when their applied_filters.latest_mode matches.",
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • changedOutput schema / properties / cap / description
      Previous value: -"Inline preview budget, in serialized characters."New value: +"The limit applied to this page."
    • changedOutput schema / properties / datasets / items / properties / unit / description
      Previous value: -"Unit of the values, already in the multiplier scale; absent when unresolved."New value: +"Unit of the values, from ILOSTAT's catalog, already in the multiplier scale; absent only when the catalog lists none."
    • changedOutput schema / properties / datasets / items / properties / unit / properties / type_label / description
      Previous value: -"Unit type label."New value: +"Unit type label; absent when ILOSTAT's structure service could not be read."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `unknown_dataset`: Any dataset ID in dataset_ids, queried or not, is not in the catalog, or a bare indicator code has several frequencies. `unknown_code`: A ref_areas, sex, classif1, classif2, or sources value is not in the ILOSTAT dictionaries. `unknown_area_group`: area_group is not X01, an ILO region or subregion, or a World Bank income group. `aggregates_unavailable`: An X-coded aggregate was requested from a dataset that has no aggregate rows. `invalid_period`: A sub-annual time on a dataset of another frequency, time combined with a range or latest_only, or time_from after time_to. `request_too_broad`: No filters at all and the unfiltered size exceeds the row ceiling. `result_too_large`: The filtered result passed the row ceiling while streaming. `dataset_retired`: Upstream reports a catalog dataset ID as deprecated or invalid. `upstream_busy`: The server-side pacer shed the call, or the ILOSTAT API answered 429 or a challenge page. `catalog_unavailable`: No catalog snapshot has loaded and the load failed, or the first load has not finished within 30 s. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `unknown_dataset`: Any dataset ID in dataset_ids, queried or not, is not in the catalog, or a bare indicator code has several frequencies. `unknown_code`: A ref_areas, sex, classif1, classif2, or sources value is not in the ILOSTAT dictionaries. `unknown_area_group`: area_group is not X01, an ILO region or subregion, or a World Bank income group. `aggregates_unavailable`: An X-coded aggregate was requested from a dataset that has no aggregate rows. `invalid_period`: A sub-annual time on a dataset of another frequency, time combined with a range or latest_only, or time_from after time_to. `request_too_broad`: No filters at all and the unfiltered size exceeds the row ceiling. `result_too_large`: The page (offset plus limit) reaches past the row ceiling of a result that holds more rows than the ceiling. `dataset_retired`: Upstream reports a catalog dataset ID as deprecated or invalid. `upstream_busy`: The server-side pacer shed the call, or the ILOSTAT API answered 429 or a challenge page. `catalog_unavailable`: No catalog snapshot has loaded and the load failed, or the first load has not finished within 30 s. Other values are possible when a failure originates below the handler."
    • addedOutput schema / properties / next_offset
      Added value: +{
      +  "description": "Offset of the next page, set when rows remain past this one; pass it as offset with the same other arguments.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / notice / description
      Previous value: -"Datasets left for another call, a latest_only fallback to the latest period per area and dataset, filters that could not narrow a dataset, a unit the structure service could not supply, why nothing matched, where the full result is staged, or why reading stopped early."New value: +"A limit past the page cap applied as the cap, datasets left for another call, a latest_only fallback to the latest period per area and dataset, filters that could not narrow a dataset, a unit the catalog does not list, the requested areas that returned no rows and why, why nothing matched, where the full result is staged, which rows the page holds and how to reach the next, or why a first page whose result passes the staging threshold was not staged (dataframes off, staging failed, or the result passes the row ceiling)."
    • changedOutput schema / properties / row_count / description
      Previous value: -"Rows the request returned — exact unless reading stopped early at the inline preview (summary.complete false), when it counts the rows read."New value: +"Rows in the result — exact when summary.complete is true; otherwise the rows read before reading stopped past this page, which the result holds at least."
    • changedOutput schema / properties / rows / description
      Previous value: -"Inline preview rows; the staged dataframe holds every row when the result is larger."New value: +"This page: at most limit rows from offset, in upstream's order (under per-series latest_only, each series' latest rows, series in the order first seen). A staged dataframe holds every row."
    • changedOutput schema / properties / summary / description
      Previous value: -"Summary over every row read, not just the preview."New value: +"Summary over every row read, not just the page."
    • addedOutput schema / properties / summary / properties / areas_without_rows
      Added value: +{
      +  "description": "Every requested area (ref_areas plus area_group members) that returned no rows, per queried dataset, in the order sent; empty when each returned rows. Absent when complete is false, no area was requested, or the result has no rows.",
      +  "items": {
      +    "additionalProperties": false,
      +    "description": "One requested area with no rows from one queried dataset.",
      +    "properties": {
      +      "dataset_id": {
      +        "description": "Queried dataset the area returned no rows from.",
      +        "type": "string"
      +      },
      +      "reason": {
      +        "description": "not_covered: absent from the dataset's area list in its SDMX structure. no_rows: listed there, but no rows for these filters and period; every entry is no_rows when that list is unavailable, which notice says.",
      +        "enum": [
      +          "not_covered",
      +          "no_rows"
      +        ],
      +        "type": "string"
      +      },
      +      "ref_area": {
      +        "description": "Requested reference area code.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "dataset_id",
      +      "ref_area",
      +      "reason"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / summary / properties / complete / description
      Previous value: -"False when reading stopped early at the inline preview, so the counts cover only the rows read."New value: +"True when the read reached the end of the result (always under per-series latest_only, whose history is read whole); false when reading stopped past this page, so the counts cover only the rows read."
    • changedOutput schema / properties / truncated / description
      Previous value: -"True when reading stopped at the inline preview and more rows exist."New value: +"True when rows remain past this page; next_offset continues."
  2. Changed12 schema fields changed
    • changedInput schema / properties / dataset_ids / description
      Previous value: -"One to three dataset IDs — an indicator code plus _A, _Q, or _M (UNE_DEAP_SEX_AGE_RT_A), as ilostat_search_indicators returns them. Case-insensitive; a DF_ prefix (the SDMX dataflow form) is stripped, a bare indicator code resolves when it has one frequency, and an element holding + or , joined IDs is split."New value: +"Dataset IDs, up to 100 — an indicator code plus _A, _Q, or _M (UNE_DEAP_SEX_AGE_RT_A), as ilostat_search_indicators returns them. Case-insensitive; a DF_ prefix (the SDMX dataflow form) is stripped, a bare indicator code resolves when it has one frequency, an element holding + or , joined IDs is split, and duplicates are dropped. Every ID is checked; the first 3 distinct datasets are queried and the rest come back as remaining_dataset_ids for another call."
    • changedInput schema / properties / dataset_ids / maxItems
      Previous value: -3New value: +100
    • changedInput schema / properties / latest_only / description
      Previous value: -"Only the latest period per reference area and dataset (the latest quarter or month on sub-annual datasets); combines with time_from/time_to."New value: +"Only each series' latest period — a series is one dataset, reference area, sex, classif1, and classif2 code — with every row at that period (one per source under source_selection all or secondary; the latest quarter or month on sub-annual datasets); combines with time_from/time_to. When the request's full history is too large or too slow to read in one call, it falls back to the latest period per area and dataset, which can miss a series that ends earlier; applied_filters.latest_mode says which ran, and the notice says so. time_from or classif1 narrow it back under; sex or fewer ref_areas alone may still read too much and fall back."
    • changedOutput schema / properties / applied_filters / properties / dataset_ids / description
      Previous value: -"Datasets requested."New value: +"Datasets queried — at most 3."
    • addedOutput schema / properties / applied_filters / properties / latest_mode
      Added value: +{
      +  "description": "How latest_only was answered: per_series, each series' own latest period; latest_year, the fallback to the latest period per area and dataset, which can miss a series that ends earlier. Absent without latest_only.",
      +  "enum": [
      +    "per_series",
      +    "latest_year"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / properties / applied_filters / properties / latest_only / description
      Previous value: -"Whether only the latest period per area was requested."New value: +"Whether only each series' latest period was requested."
    • changedOutput schema / properties / datasets / description
      Previous value: -"The requested datasets, in request order."New value: +"The queried datasets, in request order."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `unknown_dataset`: A dataset ID is not in the catalog, or a bare indicator code has several frequencies. `unknown_code`: A ref_areas, sex, classif1, classif2, or sources value is not in the ILOSTAT dictionaries. `unknown_area_group`: area_group is not X01, an ILO region or subregion, or a World Bank income group. `aggregates_unavailable`: An X-coded aggregate was requested from a dataset that has no aggregate rows. `invalid_period`: A sub-annual time on a dataset of another frequency, time combined with a range or latest_only, or time_from after time_to. `request_too_broad`: No filters at all and the unfiltered size exceeds the row ceiling. `result_too_large`: The filtered result passed the row ceiling while streaming. `dataset_retired`: Upstream reports a catalog dataset ID as deprecated or invalid. `upstream_busy`: The server-side pacer shed the call, or the ILOSTAT API answered 429 or a challenge page. `catalog_unavailable`: No catalog snapshot has loaded and the load failed, or the first load has not finished within 30 s. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `unknown_dataset`: Any dataset ID in dataset_ids, queried or not, is not in the catalog, or a bare indicator code has several frequencies. `unknown_code`: A ref_areas, sex, classif1, classif2, or sources value is not in the ILOSTAT dictionaries. `unknown_area_group`: area_group is not X01, an ILO region or subregion, or a World Bank income group. `aggregates_unavailable`: An X-coded aggregate was requested from a dataset that has no aggregate rows. `invalid_period`: A sub-annual time on a dataset of another frequency, time combined with a range or latest_only, or time_from after time_to. `request_too_broad`: No filters at all and the unfiltered size exceeds the row ceiling. `result_too_large`: The filtered result passed the row ceiling while streaming. `dataset_retired`: Upstream reports a catalog dataset ID as deprecated or invalid. `upstream_busy`: The server-side pacer shed the call, or the ILOSTAT API answered 429 or a challenge page. `catalog_unavailable`: No catalog snapshot has loaded and the load failed, or the first load has not finished within 30 s. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / notice / description
      Previous value: -"Filters that could not narrow a dataset, a unit the structure service could not supply, why nothing matched, where the full result is staged, or why reading stopped early."New value: +"Datasets left for another call, a latest_only fallback to the latest period per area and dataset, filters that could not narrow a dataset, a unit the structure service could not supply, why nothing matched, where the full result is staged, or why reading stopped early."
    • addedOutput schema / properties / remaining_dataset_ids
      Added value: +{
      +  "description": "Requested datasets past the first 3, as canonical IDs in request order; not fetched in this call. Pass them as dataset_ids with the same filters to get them. Absent when every requested dataset was queried.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / row_count / description
      Previous value: -"Rows the request returned — exact when the result is inline or staged; when reading stopped early (truncated), the rows read."New value: +"Rows the request returned — exact unless reading stopped early at the inline preview (summary.complete false), when it counts the rows read."
    • changedOutput schema / properties / summary / properties / complete / description
      Previous value: -"False when reading stopped early, so the counts cover only the rows read."New value: +"False when reading stopped early at the inline preview, so the counts cover only the rows read."
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnly/openWorld/idempotent; the description adds substantial behavior the agent could not otherwise know: codes are validated against dictionaries before the request is sent, large results are staged as df_<id> dataframes on the first page, filtered results past the ceiling are paged but not staged, and the response echoes every applied filter including the implicit best-source default. The latest_only fallback to per-area latest period and its latest_mode signalling is a genuinely non-obvious behavioral trait.

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?

Front-loaded with the core action and the 3-dataset cap in the first clause, and every subsequent sentence covers a distinct concern (row shape, validation, paging, staging, refusal). The downside is a single dense semicolon-chained paragraph with no structural breaks, which makes the staging and ceiling rules harder to scan than they need to be.

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?

For a 14-parameter, 100%-covered, output-schema-backed tool, the description covers the operationally risky parts an agent must know: dataset overflow, paging via next_offset, the dataframe staging gate ('when this deployment enables dataframes'), and the ceiling refusal modes. Return-value detail is backed by the output schema, so nothing an agent needs in order to call this correctly is missing.

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 schema already carries per-parameter detail and a baseline of 3 applies. The description still adds cross-parameter meaning the schema does not foreground as a whole: the interaction between dataset_ids overflow and remaining_dataset_ids, the echoed applied_filters, and the ceiling/paging interaction with filters. It stops short of restating the individual filter semantics, which is appropriate given the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and resource — 'Fetch observations for up to 3 ILOSTAT datasets per call' — then enumerates the filter dimensions (area, sex, classif1/classif2, source, period). This is clearly distinguishable from siblings like ilostat_describe_indicator or ilostat_dataframe_query, which are named as different tools rather than as variants of the same fetch.

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

Usage Guidelines5/5

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

Explicitly routes the agent: use ilostat_list_reference for valid codes, ilostat_describe_indicator for the codes a dataset actually uses, and ilostat_dataframe_describe/ilostat_dataframe_query for SQL over staged dataframes. It also states the overflow path — datasets past the first 3 come back as remaining_dataset_ids 'for another call' — and describes the refusal conditions (no-filter request over the ceiling, page past the ceiling).

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.