Skip to main content
Glama

ilostat-mcp-server

Compare areas on an ILOSTAT dataset

ilostat_compare_geographies
Read-onlyIdempotent

Compare reference areas on one ILOSTAT dataset and one slice — a sex code plus breakdown codes, defaulting to the dataset's totals — giving each area's value at a common period or at its latest non-projected period, optional change over N years, and a rank, with each value's period, source, status, and basis (reported, modelled_estimate, or projection). A change carries the earlier value's source, basis, status, and notes, and flags whether the source or basis differs or the series breaks between the two values. Areas without a value are listed separately with the reason, and the response flags mixed periods and mixed bases rather than hiding them. The areas with a value come back limit at a time from offset, in the sort order, and next_offset continues; ranks, missing, and comparability always cover every area. Select areas by code list, by group (X01 for every country, an ILO region or subregion, or a World Bank income group), or both; X-coded aggregates require a dataset with aggregates.

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_id": "<dataset_id>"
    },
    "name": "ilostat_compare_geographies"
  }
}

Input Schema

NameRequiredDescriptionDefault
sexNoSex code SEX_T, SEX_M, SEX_F, or SEX_O; T/M/F/O and total/both/male/female/other are accepted. Defaults to SEX_T on a dataset with a sex breakdown; refused on one without.
sortNoRow order: value_desc (default), value_asc, or ref_area. rank is always by value, highest first.value_desc
limitNoAreas per page.
offsetNoAreas to skip, in the sort order: 0 for the first page, else the previous page's next_offset, with the same other arguments.
periodNoA common period, YYYY, YYYYQn, or YYYYMmm matching the dataset frequency (2024-Q2 and 2025-03 are normalized). Omit to compare each area at its latest period.
classif1NoFirst breakdown code, case-insensitive. Defaults to the dataset's total code; required when the breakdown has no total (deciles); refused on a dataset without the breakdown. ilostat_describe_indicator lists the dataset's codes and marks its totals.
classif2NoSecond breakdown code; same defaults and rules as classif1.
ref_areasNoReference areas (up to 300): ISO3 codes (USA) or X-coded aggregates (X01 World); case-insensitive, ILO_GEO_ forms accepted. At least one of ref_areas or area_group is required.
area_groupNoX01 for every country, an ILO region or subregion, or a World Bank income group (X06, X56, X02, …); expands to its member countries. The group's own aggregate is compared only when listed in ref_areas. ilostat_list_reference topic area_groups lists the codes.
dataset_idYesOne dataset ID (UNE_DEAP_SEX_AGE_RT_A), as ilostat_search_indicators returns it; case-insensitive, a DF_ prefix (the SDMX dataflow form) stripped, a bare indicator code resolved when it has one frequency.
change_yearsNoAdds each value's change from the same sub-period this many years earlier, in the dataset unit.
lookback_yearsNoLatest mode: an area's latest value must fall within this many years of the current year.
include_projectionsNoLatest mode: let projections (ILO modelled values after the cutoff) be an area's latest value.

Output Schema

NameRequiredDescriptionDefault
capNoThe limit applied to this page.
modeNolatest: each area's latest value; period: every area at one period.
rowsNoThis page of the areas with a value: at most limit from offset, in the requested order. A staged dataframe holds every area.
errorNoPresent when the call failed. Absent on success.
shownNoRows returned inline.
sliceNoThe one series compared per area.
legendNoLabels for the status flags and note codes in rows.
noticeNoMixed periods, mixed bases, changes that are not like-for-like, missing areas, a unit the catalog does not list or an area list the structure service could not supply, where the full comparison is staged, which areas the page holds and how to reach the next, or why a first page whose comparison passes the staging threshold was not staged.
periodNoPeriod mode: the period compared.
datasetNoOne requested dataset and how its values are classed.
missingNoRequested areas with no value, and why.
dataframeNoThe staged dataframe holding the full result; present only when staged.
truncatedNoTrue when areas remain past this page, whether or not a dataframe holds the full comparison; next_offset continues.
attributionNoCitation to keep with any use of the data.
next_offsetNoOffset of the next page, set when areas remain past this one; pass it as offset with the same other arguments.
window_fromNoLatest mode: the first year requested — lookback_years before the current year, and change_years further back to reach the change base. A latest value still falls within lookback_years.
change_yearsNoYears the change is measured over, when requested.
comparabilityNoWhat makes the current values more or less comparable, over every area; each change's baseline is compared by its own source_changed, basis_changed, and break_in_series.
applied_filtersNoEvery parameter sent upstream.
include_projectionsNoWhether a projection could be an area's latest value.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • addedInput schema / properties / limit
      Added value: +{
      +  "default": 50,
      +  "description": "Areas per page.",
      +  "maximum": 9007199254740991,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "default": 0,
      +  "description": "Areas to skip, in the sort order: 0 for the first page, else the previous page's next_offset, with the same other arguments.",
      +  "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 / dataset / 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 / dataset / 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."
    • addedOutput schema / properties / next_offset
      Added value: +{
      +  "description": "Offset of the next page, set when areas remain past this one; pass it as offset with the same other arguments.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / notice / description
      Previous value: -"Mixed periods, mixed bases, changes that are not like-for-like, missing areas, a unit or area list the structure service could not supply, where the full comparison is staged, or why the inline rows stop early."New value: +"Mixed periods, mixed bases, changes that are not like-for-like, missing areas, a unit the catalog does not list or an area list the structure service could not supply, where the full comparison is staged, which areas the page holds and how to reach the next, or why a first page whose comparison passes the staging threshold was not staged."
    • changedOutput schema / properties / rows / description
      Previous value: -"Areas with a value, in the requested order; the staged dataframe holds all when larger."New value: +"This page of the areas with a value: at most limit from offset, in the requested order. A staged dataframe holds every area."
    • changedOutput schema / properties / truncated / description
      Previous value: -"True when the inline rows stop before the last area — also when a dataframe holds the full comparison."New value: +"True when areas remain past this page, whether or not a dataframe holds the full comparison; next_offset continues."
  2. Changed15 schema fields changed
    • changedOutput schema / properties / applied_filters / properties / time / description
      Previous value: -"Exact periods sent (period mode)."New value: +"Exact periods sent: period mode without change_years, or the period and its change base when the years between could not be read within the call's size and time limits."
    • changedOutput schema / properties / applied_filters / properties / time_from / description
      Previous value: -"First year sent (latest mode); no end year is sent."New value: +"First year sent: latest mode's window start (no end year is sent), or period mode's change base year."
    • addedOutput schema / properties / applied_filters / properties / time_to
      Added value: +{
      +  "description": "Last year sent: the period's year, in period mode with change_years.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / comparability / description
      Previous value: -"What makes the values more or less comparable, over every area."New value: +"What makes the current values more or less comparable, over every area; each change's baseline is compared by its own source_changed, basis_changed, and break_in_series."
    • changedOutput schema / properties / notice / description
      Previous value: -"Mixed periods, mixed bases, missing areas, a unit or area list the structure service could not supply, where the full comparison is staged, or why the inline rows stop early."New value: +"Mixed periods, mixed bases, changes that are not like-for-like, missing areas, a unit or area list the structure service could not supply, where the full comparison is staged, or why the inline rows stop early."
    • changedOutput schema / properties / rows / items / properties / change / description
      Previous value: -"Change over change_years; absent when the earlier value is missing."New value: +"Change over change_years with the earlier value's provenance; absent when the earlier value is missing. delta is like-for-like only when source_changed, basis_changed, and break_in_series are all false."
    • addedOutput schema / properties / rows / items / properties / change / properties / basis_changed
      Added value: +{
      +  "description": "True when the earlier value has another basis.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / rows / items / properties / change / properties / break_in_series
      Added value: +{
      +  "description": "True when a break in series (status B or an I11 note) is marked on the value or on an observation of its source after from_period: the series' method changed within the span. A break marked on the earlier value alone came before the span and does not count. null when only the two periods were read (notice says so) and the value marks no break: a break between them is unknown.",
      +  "type": [
      +    "boolean",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / rows / items / properties / change / properties / from_basis
      Added value: +{
      +  "description": "Basis of the earlier value: reported, modelled_estimate, or projection.",
      +  "enum": [
      +    "reported",
      +    "modelled_estimate",
      +    "projection"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / rows / items / properties / change / properties / from_notes
      Added value: +{
      +  "description": "Note codes of the earlier value (legend.notes decodes them).",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / rows / items / properties / change / properties / from_obs_status
      Added value: +{
      +  "description": "Status flag of the earlier value (legend.obs_status decodes it).",
      +  "type": "string"
      +}
    • addedOutput schema / properties / rows / items / properties / change / properties / from_source
      Added value: +{
      +  "description": "Source code of the earlier value.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / rows / items / properties / change / properties / from_source_label
      Added value: +{
      +  "description": "Source label of the earlier value.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / rows / items / properties / change / properties / source_changed
      Added value: +{
      +  "description": "True when the earlier value comes from another source.",
      +  "type": "boolean"
      +}
    • changedOutput schema / properties / rows / items / properties / change / required
      Previous value: -[
      -  "from_period",
      -  "from_value",
      -  "delta"
      -]New value: +[
      +  "from_period",
      +  "from_value",
      +  "delta",
      +  "from_source",
      +  "from_basis",
      +  "from_notes",
      +  "source_changed",
      +  "basis_changed",
      +  "break_in_series"
      +]
  3. First observed

TDQS

A4/5.0
Behavior5/5

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

Beyond the readOnly/idempotent/openWorld annotations, the description discloses substantial behavior: each value carries period, source, status, and basis (reported, modelled_estimate, projection); a change inherits the earlier value's source, basis, status, and notes and flags source/basis shifts or series breaks; areas without a value are listed separately with reasons; mixed periods and mixed bases are surfaced rather than hidden. It also explains a non-obvious pagination contract — limit/offset paginate only the valued rows, while ranks, missing, and comparability always cover every area.

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?

It is front-loaded with purpose and each sentence carries content, but the prose is dense and long, and the pagination sentence ("limit at a time from offset, in the sort order, and next_offset continues") duplicates what the schema fields already document at 100% coverage. The density makes it harder to scan than necessary for a tool whose parameters are already fully annotated.

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 a 13-parameter comparison tool with an output schema and full annotation coverage, the description covers the selection model, period modes, change semantics, missing-area handling, and pagination contract — enough for an agent to call it correctly. Minor gaps remain around how rank ties and the mismatch between paginated rows and full-coverage ranks interact in practice, but the output schema absorbs most of the return-value burden.

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 explains every parameter, including the sex, sort, period, classif, ref_areas, area_group, and change_years semantics — the baseline is 3. The description adds a little framing ("one slice — a sex code plus breakdown codes, defaulting to the dataset's totals" and the change-record unpacking) but largely restates parameter behavior already documented in the schema, so it does not clearly earn above baseline.

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 opens with a specific verb and resource: "Compare reference areas on one ILOSTAT dataset and one slice." It makes the scope explicit (multi-area comparison on a single dataset and slice) and names the helper tools for resolving codes (ilostat_describe_indicator, ilostat_list_reference, ilostat_search_indicators). It never explicitly contrasts itself with ilostat_query_indicator or ilostat_get_country_profile, so an agent must infer why it would pick this over a single-indicator query, which keeps it short of a 5.

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?

Usage context is clear: pick a common period to compare areas side by side, omit period for each area's latest non-projected value, select areas by code list, by group, or both, and note that X-coded aggregates require a dataset with aggregates. It also states that a group's own aggregate is compared only when listed in ref_areas. There are no explicit when-not conditions or named alternative tools for the comparison task itself, so it lands at 4 rather than 5.

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.