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
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 / 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"
      +]
  2. 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"
  3. 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"
      -}
  4. 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"
      +}
  5. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/openWorld/non-destructive, so safety needs no restating. The description adds behavior beyond that: it discloses partial-failure handling ('any country without data'), the provenance fields returned (source, last updated), and the input constraint that groups are rejected. Return-shape detail overlaps somewhat with the existing output schema.

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-loads the trigger, then inputs, returns, and the group constraint — a sensible order with no filler sentences. It is a single dense block, though, and the group-expansion caveat would land harder if surfaced earlier.

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?

With an output schema and full annotations supplied, the description covers the remaining burden well: when to call, what to pass, what comes back, and how missing data is reported. The only gap is guidance for the adjacent single-country case, which is not addressed.

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 coverage is 100%, so country format, indicators, year bounds and order semantics are already fully documented in the schema. The description only restates which inputs to pass and that they are optional, adding no format or default nuance beyond the schema's own descriptions.

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 pair ('compare or rank') and resource ('countries on one statistic'), with two concrete example phrasings. The 2-to-6-country ranking scope functionally separates it from a single-indicator lookup sibling, so an agent can classify the request without opening the schema.

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?

Opens with an explicit trigger condition ('Use this when the user asks to compare or rank countries on one statistic') plus illustrative utterances, and adds a real exclusion: groups like Nordic or G7 must be expanded first because 'groups themselves are not accepted.' What it lacks is any naming of alternatives (e.g., the single-country indicator tool) for the one-country case, so the agent must infer the boundary.

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.