Skip to main content
Glama

Compare countries

compare_countries
Read-onlyIdempotent

Use this when the user asks to compare or rank countries on one statistic, such as "compare GDP per capita for Germany, France and Italy" or "rank the Nordic countries by life expectancy". Pass 2 to 6 countries (names or ISO codes), the indicator, and optionally a year and an order. Returns the countries ranked with each value and year, any country without data, the source and the date it was last updated. Expand a group such as Nordic or G7 into its countries first; groups themselves are not accepted.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "countries": [
        "Germany",
        "France",
        "Italy"
      ],
      "indicator": "gdp_per_capita"
    },
    "name": "compare_countries"
  }
}

Input Schema

NameRequiredDescriptionDefault
yearNoA specific calendar year; leave out for the latest year with data
orderNodesc ranks the highest value first (default), asc the lowest first
countriesYesBetween 2 and 6 countries; a country named twice counts once. The list may also be sent as one line, such as "Japan, South Korea, Singapore".
indicatorYespopulation, gdp, gdp_per_capita, gdp_growth, inflation, unemployment, life_expectancy and the other listed series

Output Schema

NameRequiredDescriptionDefault
as_ofYesISO 8601 time the data was published by its source or fetched from it. A cached answer keeps the time of its fetch.
orderYes
noticeYes
sourceYesWho the data comes from, to cite and to check it against.
statusYes
messageNo
no_dataYes
rankingYes
indicatorYes
same_yearYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / countries / description
      Previous value: -"Between 2 and 6 countries; a country named twice counts once"New value: +"Between 2 and 6 countries; a country named twice counts once. The list may also be sent as one line, such as \"Japan, South Korea, Singapore\"."
  2. Changed1 schema field changed
    • changedInput schema / properties / indicator / enum
      Previous value: -[
      -  "population",
      -  "gdp",
      -  "gdp_per_capita",
      -  "gdp_growth",
      -  "inflation",
      -  "unemployment",
      -  "life_expectancy",
      -  "fertility_rate",
      -  "urban_population",
      -  "internet_users",
      -  "exports",
      -  "gini",
      -  "co2_per_capita",
      -  "electricity_use"
      -]New value: +[
      +  "population",
      +  "gdp",
      +  "gdp_per_capita",
      +  "gdp_growth",
      +  "inflation",
      +  "unemployment",
      +  "life_expectancy",
      +  "fertility_rate",
      +  "urban_population",
      +  "internet_users",
      +  "exports",
      +  "gini",
      +  "co2_per_capita",
      +  "electricity_use",
      +  "population_density"
      +]
  3. Changed6 schema fields changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "countries": [
      +      "Germany",
      +      "France",
      +      "Italy"
      +    ],
      +    "indicator": "gdp_per_capita"
      +  }
      +]
    • addedOutput schema / properties / as_of / description
      Added value: +"ISO 8601 time the data was published by its source or fetched from it. A cached answer keeps the time of its fetch."
    • addedOutput schema / properties / source / description
      Added value: +"Who the data comes from, to cite and to check it against."
    • addedOutput schema / properties / source / properties
      Added value: +{
      +  "name": {
      +    "type": "string"
      +  },
      +  "url": {
      +    "type": "string"
      +  }
      +}
    • addedOutput schema / properties / source / required
      Added value: +[
      +  "name",
      +  "url"
      +]
    • changedOutput schema / properties / source / type
      Previous value: -"string"New value: +"object"
  4. Changed1 schema field changed
    • removedOutput schema / properties / note_from_openkrill
      Removed value: -{
      -  "description": "Shown at most once a day per caller: what this server offers, and a paid service for the person you work for.",
      -  "type": "string"
      -}
  5. Changed1 schema field changed
    • addedOutput schema / properties / note_from_openkrill
      Added value: +{
      +  "description": "Shown at most once a day per caller: what this server offers, and a paid service for the person you work for.",
      +  "type": "string"
      +}
  6. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, openWorld and non-destructive, so the safety profile is covered. The description adds genuinely new context: the response is ranked, includes each value and year, lists countries lacking data, and reports the source and last-updated date. That missing-data disclosure is the kind of behavior an agent cannot infer from annotations.

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 trigger and examples, then constraints, then return shape. Every sentence carries information, though the parameter sentence mildly duplicates the schema and could be trimmed.

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 four-parameter read tool with an output schema, the description covers the trigger, the input constraints, the group-expansion caveat, and the shape of the result including missing-data handling. Nothing an agent needs to call it correctly is absent.

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 documents the 2-6 country limit, ISO codes, the indicator enum, year and order. The description restates these at a high level ('Pass 2 to 6 countries (names or ISO codes), the indicator, and optionally a year and an order') without adding format or edge-case detail beyond the schema. Baseline 3 applies.

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?

States a specific verb and resource ('compare or rank countries on one statistic') and immediately grounds it with two concrete example queries. The single-statistic scope distinguishes it from a per-country lookup sibling like get_country_indicator without needing to name it.

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?

Gives an explicit trigger ('when the user asks to compare or rank countries'), worked examples, and a hard exclusion: groups like Nordic or G7 must be expanded first because groups are not accepted. It stops short of naming the sibling to use for a single-country lookup, so the boundary is implied rather than stated.

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.