Skip to main content
Glama

Resolve country

resolve_country
Read-onlyIdempotent

Turns a country name, alias or code (English, Japanese, Chinese) into ISO codes: matches[] {iso2, iso3, name, score}, best first, max 5, empty if none. Call it first when you only have a name: get_country_facts, check_entry_requirements, get_trip_brief and the other tools take ISO codes. Exact, prefix (3+ chars) or substring (4+) match, ignoring case and punctuation; no spelling correction. Names only (CLDR): no sources or confidence. Parameters: pass query as the user wrote it; if nothing matches, retry with the official or local name. lang only localizes the returned names. Examples: {"query":"日本"}, {"query":"South Korea","lang":"ja"}. Read-only; free and keyless, no quota.

Input Schema

NameRequiredDescriptionDefault
langNoLanguage for localized names (BCP 47). Supported: en, ja, zh-Hans, zh-Hant; aliases such as zh, zh-CN, zh-TW and zh-HK are mapped, and anything else falls back to English. Only names are localized; verbatim official quotes stay in their original language.en
queryYesCountry name, alias or code, in English, Japanese or Chinese. Case-, space- and punctuation-insensitive (a leading "the" is ignored); matches exactly, by prefix (3+ characters) or by substring (4+ characters); not a spelling corrector.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • addedInput schema / properties / lang / default
      Added value: +"en"
    • changedInput schema / properties / lang / description
      Previous value: -"Response language (BCP 47). Supported: en, ja, zh-Hans, zh-Hant; falls back to English. Verbatim official quotes always stay in their original language."New value: +"Language for localized names (BCP 47). Supported: en, ja, zh-Hans, zh-Hant; aliases such as zh, zh-CN, zh-TW and zh-HK are mapped, and anything else falls back to English. Only names are localized; verbatim official quotes stay in their original language."
    • addedInput schema / properties / lang / examples
      Added value: +[
      +  "en",
      +  "ja",
      +  "zh-Hans",
      +  "zh-Hant"
      +]
    • addedInput schema / properties / query / description
      Added value: +"Country name, alias or code, in English, Japanese or Chinese. Case-, space- and punctuation-insensitive (a leading \"the\" is ignored); matches exactly, by prefix (3+ characters) or by substring (4+ characters); not a spelling corrector."
    • addedInput schema / properties / query / examples
      Added value: +[
      +  "Japan",
      +  "日本",
      +  "UK",
      +  "Côte d'Ivoire"
      +]
    • addedInput schema / properties / query / minLength
      Added value: +1
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "anyOf": [
      +    {
      +      "properties": {
      +        "matches": {
      +          "description": "Up to 5 matches, best first. Empty when nothing matches.",
      +          "items": {
      +            "properties": {
      +              "iso2": {
      +                "type": "string"
      +              },
      +              "iso3": {
      +                "type": "string"
      +              },
      +              "matched": {
      +                "description": "The name or code that matched.",
      +                "type": "string"
      +              },
      +              "name": {
      +                "type": "string"
      +              },
      +              "score": {
      +                "maximum": 1,
      +                "minimum": 0,
      +                "type": "number"
      +              }
      +            },
      +            "required": [
      +              "iso2",
      +              "score"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "query": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "query",
      +        "matches"
      +      ],
      +      "title": "Result",
      +      "type": "object"
      +    },
      +    {
      +      "description": "Only on error results (isError: true): RFC 9457 problem, e.g. unknown country, no data, key required, rate limited, sanctions block.",
      +      "properties": {
      +        "detail": {
      +          "type": "string"
      +        },
      +        "status": {
      +          "type": "integer"
      +        },
      +        "title": {
      +          "type": "string"
      +        },
      +        "type": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "type",
      +        "title",
      +        "status"
      +      ],
      +      "title": "Error (problem details)",
      +      "type": "object"
      +    },
      +    {
      +      "description": "Only on error results (isError: true): x402 v2 payment requirements. Pay and retry with _meta[\"x402/payment\"].",
      +      "properties": {
      +        "accepts": {
      +          "type": "array"
      +        },
      +        "error": {
      +          "type": "string"
      +        },
      +        "extensions": {
      +          "type": "object"
      +        },
      +        "resource": {
      +          "type": "object"
      +        },
      +        "x402Version": {
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "x402Version",
      +        "accepts"
      +      ],
      +      "title": "Error (x402 payment request)",
      +      "type": "object"
      +    }
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint/idempotentHint, but the description adds real behavioral context: free/keyless/no quota, no spelling correction, matching semantics, max 5 results and empty on no match. This goes well beyond what annotations provide.

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?

Dense but front-loaded: purpose first, then result shape, then routing guidance, then parameter notes and examples. Every clause carries information, though the sentences are quite packed.

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 present the description needn't explain returns, yet it summarizes them anyway; it covers matching behavior, limits, failure mode, parameter usage and cost. Nothing needed to invoke it correctly is missing.

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 adds value beyond the schema with the operational advice to pass the query as written and retry with the official/local name, and it clarifies that lang localizes only names.

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 precise verb+resource ('turns a country name, alias or code into ISO codes') and names the output shape. It also explicitly distinguishes itself from siblings by noting that get_country_facts, check_entry_requirements and get_trip_brief take ISO codes instead.

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?

Gives an explicit when-to-use rule ('Call it first when you only have a name') and names the alternative tools that require ISO codes. Also supplies retry guidance when the first query misses.

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.

Resources