Skip to main content
Glama

openaq-mcp-server: list countries

openaq_list_countries
Read-onlyIdempotent

Catalog of country-level coverage: id, OpenAQ country code, name, the date span of available station data (datetimeFirst/datetimeLast), and which parameters are measured anywhere in that country. The availability check before a regional sweep — answers "which countries have NO2 monitoring?" and tells you whether a country has recent data before you call openaq_find_locations. Coverage is uneven worldwide; this surfaces where measured data exists. Results come a page at a time (20 countries by default); totalCount is the full filtered count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoWhich page of the filtered list to return (1-based). Default 1. With limit 20, page 2 returns countries 21–40. A page past the last one returns no countries and a notice naming the last page.
limitNoMax countries to return (1–100). Default 20. Applied after query and parametersId, in OpenAQ catalog order.
queryNoCase-insensitive filter over the country catalog by code and name. A two-letter query matches an exact ISO 3166-1 alpha-2 code first (e.g. "US" → United States) and falls back to substrings when no code matches; longer queries match as substrings (e.g. "united", "germany"). Omit to page through the whole catalog.
parametersIdNoOnly return countries that measure this parameter id somewhere (e.g. 2 = PM2.5 µg/m³) — the one-call answer to "which countries have NO2 monitoring?". Get ids from openaq_list_parameters; the same pollutant has several ids for different units. Composes with query.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
capNoThe limit that was applied.
errorNoPresent when the call failed. Absent on success.
shownNoNumber of countries returned on this page.
noticeNoGuidance when the filters matched nothing, when more pages follow (the next page to request), or when the page is past the last one.
countriesNoMatching countries with coverage metadata.
truncatedNoTrue when more matching countries follow on later pages.
totalCountNoCountries matched after query and parametersId, across every page.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / query / description
      Previous value: -"Case-insensitive filter over the country catalog by code and name. A two-letter query is treated as an exact ISO 3166-1 alpha-2 code (e.g. \"US\" → United States); longer queries match as substrings (e.g. \"united\", \"germany\"). Omit to page through the whole catalog."New value: +"Case-insensitive filter over the country catalog by code and name. A two-letter query matches an exact ISO 3166-1 alpha-2 code first (e.g. \"US\" → United States) and falls back to substrings when no code matches; longer queries match as substrings (e.g. \"united\", \"germany\"). Omit to page through the whole catalog."
  2. Changed11 schema fields changed
    • addedInput schema / properties / limit
      Added value: +{
      +  "default": 20,
      +  "description": "Max countries to return (1–100). Default 20. Applied after query and parametersId, in OpenAQ catalog order.",
      +  "maximum": 100,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / page
      Added value: +{
      +  "default": 1,
      +  "description": "Which page of the filtered list to return (1-based). Default 1. With limit 20, page 2 returns countries 21–40. A page past the last one returns no countries and a notice naming the last page.",
      +  "maximum": 9007199254740991,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / parametersId / exclusiveMinimum
      Added value: +0
    • removedInput schema / properties / parametersId / minimum
      Removed value: --9007199254740991
    • changedInput schema / properties / query / description
      Previous value: -"Case-insensitive filter over the bounded country catalog (~153) by code and name. A two-letter query is treated as an exact ISO 3166-1 alpha-2 code (e.g. \"US\" → United States); longer queries match as substrings (e.g. \"united\", \"germany\"). Omit to list all."New value: +"Case-insensitive filter over the country catalog by code and name. A two-letter query is treated as an exact ISO 3166-1 alpha-2 code (e.g. \"US\" → United States); longer queries match as substrings (e.g. \"united\", \"germany\"). Omit to page through the whole catalog."
    • addedOutput schema / properties / cap
      Added value: +{
      +  "description": "The limit that was applied.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / countries / items / properties / code / description
      Previous value: -"ISO 3166-1 alpha-2 code — pass as iso to openaq_find_locations"New value: +"OpenAQ country code: ISO 3166-1 alpha-2, or \"-99\" where OpenAQ has none — pass as iso to openaq_find_locations"
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance when the query matched nothing."New value: +"Guidance when the filters matched nothing, when more pages follow (the next page to request), or when the page is past the last one."
    • addedOutput schema / properties / shown
      Added value: +{
      +  "description": "Number of countries returned on this page.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / totalCount / description
      Previous value: -"Total countries matched after filtering."New value: +"Countries matched after query and parametersId, across every page."
    • addedOutput schema / properties / truncated
      Added value: +{
      +  "description": "True when more matching countries follow on later pages.",
      +  "type": "boolean"
      +}
  3. Changed4 schema fields changed
    • removedOutput schema / properties / countries / items / properties / datetimeFirst / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / countries / items / properties / datetimeFirst / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / countries / items / properties / datetimeLast / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / countries / items / properties / datetimeLast / type
      Added value: +[
      +  "string",
      +  "null"
      +]
  4. 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"
      +    ]
      +  },
      +  {
      +    "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: `upstream_error`: OpenAQ /countries returned 5xx or an unreadable body on every retry. `rate_limited`: OpenAQ returned 429 — the request budget for this key is exhausted. `upstream_timeout`: OpenAQ /countries did not respond within the request timeout on every retry. `invalid_api_key`: OpenAQ returned 401 — the configured OPENAQ_API_KEY is missing, invalid, or revoked. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "upstream_error",
      +            "rate_limited",
      +            "upstream_timeout",
      +            "invalid_api_key"
      +          ],
      +          "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"
      -]
  5. Changed1 schema field changed
    • addedInput schema / properties / parametersId
      Added value: +{
      +  "description": "Only return countries that measure this parameter id somewhere (e.g. 2 = PM2.5 µg/m³) — the one-call answer to \"which countries have NO2 monitoring?\". Get ids from openaq_list_parameters; the same pollutant has several ids for different units. Composes with query.",
      +  "maximum": 9007199254740991,
      +  "minimum": -9007199254740991,
      +  "type": "integer"
      +}
  6. Changed1 schema field changed
    • changedInput schema / properties / query / description
      Previous value: -"Local case-insensitive filter on country code and name (e.g. \"united\", \"IN\", \"germany\"). The list is bounded (~153 countries); omit to list all. Filters the fetched list on our side, not an upstream search."New value: +"Case-insensitive filter over the bounded country catalog (~153) by code and name. A two-letter query is treated as an exact ISO 3166-1 alpha-2 code (e.g. \"US\" → United States); longer queries match as substrings (e.g. \"united\", \"germany\"). Omit to list all."
  7. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, so the description doesn't need to cover safety. It adds behavioral details beyond annotations: pagination behavior ('Results come a page at a time (20 countries by default); totalCount is the full filtered count') and data coverage note ('Coverage is uneven worldwide'). These are useful traits not conveyed by annotations, so the description adds value.

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?

The description is four sentences, each earning its place: the first defines the output fields, the second gives usage context, the third notes data quality, and the fourth explains pagination. It is front-loaded with the core purpose and contains zero filler or redundancy.

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?

Given the tool's moderate complexity (4 optional params), the presence of a detailed output schema, and annotations covering read-only behavior, the description is complete. It explains what the tool returns, when to use it, pagination, and data quality caveats. An agent has everything needed to decide and invoke it correctly.

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?

The input schema has 100% coverage with rich, self-contained descriptions for every parameter (page, limit, query, parametersId). For example, parametersId already explains 'Get ids from openaq_list_parameters' and the 'NO2 monitoring' use case. The tool description adds no new parameter-specific meaning beyond what the schema provides, so the baseline of 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?

The description clearly states it returns a catalog of country-level coverage with specific fields (id, code, name, date span, parameters). It uses a specific verb (list/catalog) and resource (countries), and distinguishes itself from siblings by positioning it as an availability check before openaq_find_locations. The purpose is unambiguous and differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly states when to use this tool: 'The availability check before a regional sweep' and 'tells you whether a country has recent data before you call openaq_find_locations.' It also names the sibling (openaq_find_locations) as the next step, and answers specific questions like 'which countries have NO2 monitoring?' This is explicit usage guidance with a clear alternative.

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.