Skip to main content
Glama

List World Bank Countries

worldbank_list_countries
Read-onlyIdempotent

List countries and regional aggregates with metadata: ISO codes, region, income level, lending type, capital, and coordinates. Filter by region code (e.g. EAS, SSF, NAC), income level (LIC, LMC, UMC, HIC), and lending type (IDX for IDA, IBD for IBRD, IDB for Blend); filters combine by AND. Aggregate entries are excluded by default, leaving individual countries only; set include_aggregates=true to also return region, income group, and world aggregate entities.

Input Schema

NameRequiredDescriptionDefault
pageNoPagination page number (1-based).
regionNoFilter by World Bank region code. A country's region.id is one of EAS (East Asia & Pacific), ECS (Europe & Central Asia), LCN (Latin America & Caribbean), MEA (Middle East, North Africa, Afghanistan & Pakistan), NAC (North America), SAS (South Asia), or SSF (Sub-Saharan Africa). Any other World Bank region or grouping code also filters, by membership: AFE (Africa Eastern and Southern), AFW (Africa Western and Central), ARB (Arab World), EUU (European Union), LDC (Least developed countries), and the rest of the codes the World Bank publishes for regions.
per_pageNoResults per page (default: server default). Positive integers above 300 are served at that maximum with the requested and served sizes echoed and a notice. totalPages uses the served size.
source_idNoSelect a source-specific entity listing. Entries carry canonical id, name and sourceId only; global classification filters and include_aggregates=true are unavailable. Default false keeps all source entities.
income_levelNoFilter by income group code: LIC (Low income), LMC (Lower middle income), UMC (Upper middle income), HIC (High income).
lending_typeNoFilter by World Bank lending type code: IDX (IDA), IBD (IBRD), IDB (Blend — eligible for both), or LNX (Not classified). IDX, IBD, and IDB are also the codes worldbank_get_poverty takes for its lending groups; a country's lendingType field reports the name (IDA, IBRD, Blend, Not classified).
include_aggregatesNoWhen true, includes regional, income-group, and world aggregate entries alongside individual countries. Default false (individual countries only). No aggregate is returned under region or lending_type, whichever code is given, so this changes nothing when either is set.

Output Schema

NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
noticeNoContext for an empty page — which filters matched nothing, or the page range that exists when the requested page is past the end — or for a page size reduced to the page cap.
countriesNoCountries (and optionally aggregates) matching the filters.
totalCountNoTotal matching entries before pagination (includes aggregates if include_aggregates=true).
totalPagesNoTotal number of pages.
currentPageNoPage number requested — past totalPages when the request ran off the end.
appliedFiltersNoThe effective listing parameters — which filters were in force and the page size served.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changed
    • changedInput schema / properties / per_page / description
      Previous value: -"Results per page (default: server default, max: 300). One page holds at most 150 entries, which keeps a response within about 50 KB; a larger value is reduced to that cap and echoed as appliedFilters.perPage, and totalPages is counted at the reduced size, so page + 1 continues where a page ends; notice discloses the reduction whenever the result runs past one page."New value: +"Results per page (default: server default). Positive integers above 300 are served at that maximum with the requested and served sizes echoed and a notice. totalPages uses the served size."
    • changedInput schema / properties / per_page / maximum
      Previous value: -300New value: +9007199254740991
    • addedInput schema / properties / source_id
      Added value: +{
      +  "description": "Select a source-specific entity listing. Entries carry canonical id, name and sourceId only; global classification filters and include_aggregates=true are unavailable. Default false keeps all source entities.",
      +  "pattern": "^\\s*\\d*\\s*$",
      +  "type": "string"
      +}
    • addedOutput schema / properties / appliedFilters / properties / sourceId
      Added value: +{
      +  "description": "Source dataset requested, omitted for the global country listing.",
      +  "type": "string"
      +}
    • removedOutput schema / properties / countries / items / additionalProperties
      Removed value: -false
    • addedOutput schema / properties / countries / items / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": false,
      +    "description": "An entity from a selected source.",
      +    "properties": {
      +      "id": {
      +        "description": "Canonical source entity ID, accepted unchanged by worldbank_get_data.",
      +        "type": "string"
      +      },
      +      "name": {
      +        "description": "Source entity name.",
      +        "type": "string"
      +      },
      +      "sourceId": {
      +        "description": "Source owning this entity.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "name",
      +      "sourceId"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "description": "A country or aggregate entry.",
      +    "properties": {
      +      "capitalCity": {
      +        "description": "Capital city name (empty for aggregates).",
      +        "type": "string"
      +      },
      +      "id": {
      +        "description": "Country or aggregate ID (ISO2 or WB aggregate code).",
      +        "type": "string"
      +      },
      +      "incomeLevel": {
      +        "additionalProperties": false,
      +        "description": "World Bank income classification.",
      +        "properties": {
      +          "id": {
      +            "description": "Income level code.",
      +            "type": "string"
      +          },
      +          "name": {
      +            "description": "Income level name.",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "name"
      +        ],
      +        "type": "object"
      +      },
      +      "isAggregate": {
      +        "description": "True when this entry is a regional or income-group aggregate rather than an individual country.",
      +        "type": "boolean"
      +      },
      +      "iso2": {
      +        "description": "ISO2 country code.",
      +        "type": "string"
      +      },
      +      "latitude": {
      +        "description": "Capital latitude (empty for aggregates).",
      +        "type": "string"
      +      },
      +      "lendingType": {
      +        "description": "World Bank lending type name: IDA, IBRD, Blend, or Not classified (lending_type filters by the codes IDX, IBD, IDB, LNX). Aggregates report Aggregates.",
      +        "type": "string"
      +      },
      +      "longitude": {
      +        "description": "Capital longitude (empty for aggregates).",
      +        "type": "string"
      +      },
      +      "name": {
      +        "description": "Country or aggregate name.",
      +        "type": "string"
      +      },
      +      "region": {
      +        "additionalProperties": false,
      +        "description": "World Bank region this country belongs to.",
      +        "properties": {
      +          "id": {
      +            "description": "Region code.",
      +            "type": "string"
      +          },
      +          "name": {
      +            "description": "Region name.",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "name"
      +        ],
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "iso2",
      +      "name",
      +      "region",
      +      "incomeLevel",
      +      "lendingType",
      +      "capitalCity",
      +      "longitude",
      +      "latitude",
      +      "isAggregate"
      +    ],
      +    "type": "object"
      +  }
      +]
    • changedOutput schema / properties / countries / items / description
      Previous value: -"A country or aggregate entry."New value: +"A global country or aggregate, or an entity from the selected source."
    • removedOutput schema / properties / countries / items / properties
      Removed value: -{
      -  "capitalCity": {
      -    "description": "Capital city name (empty for aggregates).",
      -    "type": "string"
      -  },
      -  "id": {
      -    "description": "Country or aggregate ID (ISO2 or WB aggregate code).",
      -    "type": "string"
      -  },
      -  "incomeLevel": {
      -    "additionalProperties": false,
      -    "description": "World Bank income classification.",
      -    "properties": {
      -      "id": {
      -        "description": "Income level code.",
      -        "type": "string"
      -      },
      -      "name": {
      -        "description": "Income level name.",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "id",
      -      "name"
      -    ],
      -    "type": "object"
      -  },
      -  "isAggregate": {
      -    "description": "True when this entry is a regional or income-group aggregate rather than an individual country.",
      -    "type": "boolean"
      -  },
      -  "iso2": {
      -    "description": "ISO2 country code.",
      -    "type": "string"
      -  },
      -  "latitude": {
      -    "description": "Capital latitude (empty for aggregates).",
      -    "type": "string"
      -  },
      -  "lendingType": {
      -    "description": "World Bank lending type name: IDA, IBRD, Blend, or Not classified (lending_type filters by the codes IDX, IBD, IDB, LNX). Aggregates report Aggregates.",
      -    "type": "string"
      -  },
      -  "longitude": {
      -    "description": "Capital longitude (empty for aggregates).",
      -    "type": "string"
      -  },
      -  "name": {
      -    "description": "Country or aggregate name.",
      -    "type": "string"
      -  },
      -  "region": {
      -    "additionalProperties": false,
      -    "description": "World Bank region this country belongs to.",
      -    "properties": {
      -      "id": {
      -        "description": "Region code.",
      -        "type": "string"
      -      },
      -      "name": {
      -        "description": "Region name.",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "id",
      -      "name"
      -    ],
      -    "type": "object"
      -  }
      -}
    • removedOutput schema / properties / countries / items / required
      Removed value: -[
      -  "id",
      -  "iso2",
      -  "name",
      -  "region",
      -  "incomeLevel",
      -  "lendingType",
      -  "capitalCity",
      -  "longitude",
      -  "latitude",
      -  "isAggregate"
      -]
    • removedOutput schema / properties / countries / items / type
      Removed value: -"object"
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `invalid_filter`: An invalid region or income_level code was provided. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `source_not_found`: source_id does not name a source. `source_not_queryable`: The selected source has no supported country/series/time layout. `unsupported_source_filter`: Global classification filters are combined with source_id. `invalid_filter`: An invalid region or income_level code was provided. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "invalid_filter"
      -]New value: +[
      +  "source_not_found",
      +  "source_not_queryable",
      +  "unsupported_source_filter",
      +  "invalid_filter"
      +]
  2. Changed4 schema fields changed
    • changedInput schema / properties / per_page / description
      Previous value: -"Results per page (default: server default, max: 300)."New value: +"Results per page (default: server default, max: 300). One page holds at most 150 entries, which keeps a response within about 50 KB; a larger value is reduced to that cap and echoed as appliedFilters.perPage, and totalPages is counted at the reduced size, so page + 1 continues where a page ends; notice discloses the reduction whenever the result runs past one page."
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "not": {
      -      "required": [
      -        "error"
      -      ]
      -    },
      -    "required": [
      -      "countries",
      -      "totalCount",
      -      "currentPage",
      -      "totalPages"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "error"
      -    ]
      -  }
      -]New value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "countries",
      +      "appliedFilters",
      +      "totalCount",
      +      "currentPage",
      +      "totalPages"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / appliedFilters
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "The effective listing parameters — which filters were in force and the page size served.",
      +  "properties": {
      +    "includeAggregates": {
      +      "description": "Whether aggregates were requested, including the default of false.",
      +      "type": "boolean"
      +    },
      +    "incomeLevel": {
      +      "description": "Income level code applied, omitted when none.",
      +      "type": "string"
      +    },
      +    "lendingType": {
      +      "description": "Lending type code applied, omitted when none.",
      +      "type": "string"
      +    },
      +    "page": {
      +      "description": "Page number requested.",
      +      "type": "number"
      +    },
      +    "perPage": {
      +      "description": "Results per page actually served — the requested size or server default, reduced to the page cap when larger. totalPages is counted at this size.",
      +      "type": "number"
      +    },
      +    "region": {
      +      "description": "Region code applied, omitted when none.",
      +      "type": "string"
      +    },
      +    "requestedPerPage": {
      +      "description": "Page size asked for, present only when it exceeded the page cap and perPage was reduced.",
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "includeAggregates",
      +    "page",
      +    "perPage"
      +  ],
      +  "type": "object"
      +}
    • changedOutput schema / properties / notice / description
      Previous value: -"Context for an empty page: which filters matched nothing, or the page range that exists when the requested page is past the end."New value: +"Context for an empty page — which filters matched nothing, or the page range that exists when the requested page is past the end — or for a page size reduced to the page cap."
  3. Changed4 schema fields changed
    • changedInput schema / properties / include_aggregates / description
      Previous value: -"When true, includes regional, income-group, and world aggregate entries alongside individual countries. Default false (individual countries only)."New value: +"When true, includes regional, income-group, and world aggregate entries alongside individual countries. Default false (individual countries only). No aggregate is returned under region or lending_type, whichever code is given, so this changes nothing when either is set."
    • addedInput schema / properties / lending_type
      Added value: +{
      +  "anyOf": [
      +    {
      +      "const": "",
      +      "type": "string"
      +    },
      +    {
      +      "description": "IDX (IDA), IBD (IBRD), IDB (Blend), or LNX (Not classified).",
      +      "enum": [
      +        "IBD",
      +        "IDB",
      +        "IDX",
      +        "LNX"
      +      ],
      +      "type": "string"
      +    }
      +  ],
      +  "description": "Filter by World Bank lending type code: IDX (IDA), IBD (IBRD), IDB (Blend — eligible for both), or LNX (Not classified). IDX, IBD, and IDB are also the codes worldbank_get_poverty takes for its lending groups; a country's lendingType field reports the name (IDA, IBRD, Blend, Not classified)."
      +}
    • changedInput schema / properties / region / description
      Previous value: -"Filter by World Bank region code. Valid codes: EAS (East Asia & Pacific), ECS (Europe & Central Asia), LCN (Latin America & Caribbean), MEA (Middle East & North Africa), NAC (North America), SAS (South Asia), SSF (Sub-Saharan Africa)."New value: +"Filter by World Bank region code. A country's region.id is one of EAS (East Asia & Pacific), ECS (Europe & Central Asia), LCN (Latin America & Caribbean), MEA (Middle East, North Africa, Afghanistan & Pakistan), NAC (North America), SAS (South Asia), or SSF (Sub-Saharan Africa). Any other World Bank region or grouping code also filters, by membership: AFE (Africa Eastern and Southern), AFW (Africa Western and Central), ARB (Arab World), EUU (European Union), LDC (Least developed countries), and the rest of the codes the World Bank publishes for regions."
    • changedOutput schema / properties / countries / items / properties / lendingType / description
      Previous value: -"World Bank lending type classification."New value: +"World Bank lending type name: IDA, IBRD, Blend, or Not classified (lending_type filters by the codes IDX, IBD, IDB, LNX). Aggregates report Aggregates."
  4. Changed2 schema fields changed
    • changedOutput schema / properties / currentPage / description
      Previous value: -"Current page number."New value: +"Page number requested — past totalPages when the request ran off the end."
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Context for an empty page: which filters matched nothing, or the page range that exists when the requested page is past the end.",
      +  "type": "string"
      +}
  5. Changed6 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "countries",
      +      "totalCount",
      +      "currentPage",
      +      "totalPages"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / error
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Present when the call failed. Absent on success.",
      +  "properties": {
      +    "code": {
      +      "description": "JSON-RPC error code for this failure.",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "data": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "reason": {
      +          "description": "Machine-readable failure mode. Declared by this tool: `invalid_filter`: An invalid region or income_level code was provided. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "invalid_filter"
      +          ],
      +          "type": "string"
      +        },
      +        "recovery": {
      +          "additionalProperties": {},
      +          "description": "Actionable next step for the caller.",
      +          "properties": {
      +            "hint": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "hint"
      +          ],
      +          "type": "object"
      +        },
      +        "retryable": {
      +          "description": "Whether retrying may succeed.",
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "message": {
      +      "description": "Human-readable description of what went wrong.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "code",
      +    "message"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "countries",
      -  "totalCount",
      -  "currentPage",
      -  "totalPages"
      -]
  6. Changed7 schema fields changed
    • addedOutput schema / properties / currentPage
      Added value: +{
      +  "description": "Current page number.",
      +  "type": "number"
      +}
    • removedOutput schema / properties / page
      Removed value: -{
      -  "description": "Current page number.",
      -  "type": "number"
      -}
    • removedOutput schema / properties / pages
      Removed value: -{
      -  "description": "Total number of pages.",
      -  "type": "number"
      -}
    • removedOutput schema / properties / total
      Removed value: -{
      -  "description": "Total matching entries before pagination (includes aggregates if include_aggregates=true).",
      -  "type": "number"
      -}
    • addedOutput schema / properties / totalCount
      Added value: +{
      +  "description": "Total matching entries before pagination (includes aggregates if include_aggregates=true).",
      +  "type": "number"
      +}
    • addedOutput schema / properties / totalPages
      Added value: +{
      +  "description": "Total number of pages.",
      +  "type": "number"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "countries",
      -  "total",
      -  "page",
      -  "pages"
      -]New value: +[
      +  "countries",
      +  "totalCount",
      +  "currentPage",
      +  "totalPages"
      +]
  7. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and openWorldHint, so the safety profile is covered. The description adds genuine behavioral context beyond that: aggregates are dropped by default, filters combine as AND, and include_aggregates changes scope. It doesn't describe pagination or response shape, but the output schema and per_page parameter cover those.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three dense sentences, front-loaded with the resource and metadata, then filters, then the aggregate default. Every clause carries information and nothing is restated from the title.

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 7 optional parameters, full schema coverage, rich annotations, and an output schema, the description supplies what's needed to call the tool correctly. It could mention pagination behavior or the source_id trade-off, but the schema already documents both, so the gap is minor.

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 description coverage is 100%, so the baseline is 3. The description still earns credit by giving example codes (EAS, SSF, NAC; LIC–HIC; IDX/IBD/IDB) and the AND-combination semantics that the schema documents per-parameter but doesn't state jointly.

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 opens with a specific verb and resource ("List countries and regional aggregates") and enumerates the returned metadata (ISO codes, region, income level, lending type, capital, coordinates). An agent can distinguish this from worldbank_get_country, which returns a single country, without opening either 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?

It states how the three filters combine ("filters combine by AND") and clarifies the default exclusion of aggregate entities, which is real selection guidance. It stops short of explicitly naming when to use this instead of worldbank_get_country, leaving that inference to the agent.

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.