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.

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

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive), so the description's added value is the behavioral detail it gives: ranked output with value and year, reporting of countries lacking data, and the source plus last-updated date. That is real context beyond annotations, though error/failure behavior is not addressed.

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?

Four sentences, front-loaded with the trigger condition followed by parameters, return shape and the group-expansion constraint. The return-value sentence is a little long but every clause carries usable information.

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?

With an output schema covering return structure and annotations covering safety, the description supplies the remaining essentials: trigger conditions, cardinality limits, group rejection, and pointer to the source/date metadata. An agent could call this correctly without further context.

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 listing country count, year and order largely restates the schema. The one genuine addition is the semantic rule that group names such as Nordic or G7 are rejected and must be expanded into member countries, which the schema does not convey.

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?

The description names a specific verb (compare/rank) and resource (countries on one statistic) and gives two concrete example phrasings, so the agent immediately knows this is a multi-country ranking tool rather than a single-country lookup like get_country_indicator.

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?

It states clearly when to use it ('when the user asks to compare or rank countries on one statistic') and adds a hard exclusion — groups like Nordic or G7 must be expanded first. It does not explicitly name the sibling get_country_indicator as the single-country alternative, which keeps it just below a 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.