Skip to main content
Glama

get_country

Retrieve comprehensive country data including name, capital, region, population, currency, exchange rates, timezones, and phone codes using ISO2 or ISO3 country codes.

Instructions

Get full data for a country by ISO2 or ISO3 code — includes name, capital, region, population, currency, live USD exchange rate, timezones, and phone code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesISO2 (e.g. AR) or ISO3 (e.g. ARG) country code
fieldsNoDetail level: basic (fast), standard (default), full (all fields)

Implementation Reference

  • The handler function for the get_country tool that fetches data from the API based on the provided country code.
    async ({ code, fields }) => {
      const qs = fields ? `?fields=${fields}` : '';
      const data = await apiGet(`/v1/api/geo/countries/${code.toUpperCase()}${qs}`);
      return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
    }
  • Registration of the 'get_country' tool using the MCP server instance.
    server.tool(
      'get_country',
      'Get full data for a country by ISO2 or ISO3 code — includes name, capital, region, population, currency, live USD exchange rate, timezones, and phone code.',
      {
        code: z.string().min(2).max(3).describe('ISO2 (e.g. AR) or ISO3 (e.g. ARG) country code'),
        fields: z.enum(['basic', 'standard', 'full']).optional().describe('Detail level: basic (fast), standard (default), full (all fields)'),
      },
      async ({ code, fields }) => {
        const qs = fields ? `?fields=${fields}` : '';
        const data = await apiGet(`/v1/api/geo/countries/${code.toUpperCase()}${qs}`);
        return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions the tool retrieves data including a 'live USD exchange rate', implying real-time or updated information, which is useful behavioral context. However, it doesn't disclose other traits like rate limits, authentication needs, error handling, or whether it's a read-only operation (though implied by 'Get'), leaving gaps in transparency.

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 a single, efficient sentence that front-loads the purpose and key details (ISO codes, data fields). Every part earns its place by clarifying scope and content without redundancy or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description does a decent job for a simple lookup tool by specifying the data returned. However, it could be more complete by mentioning potential errors (e.g., invalid codes), response format, or limitations, especially since it lacks structured output documentation.

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 description coverage is 100%, so the schema already documents both parameters (code and fields) with descriptions and enum values. The description adds marginal value by mentioning ISO2/ISO3 codes and listing some data fields, but doesn't provide additional syntax, format details, or constraints beyond what the schema specifies.

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 the verb 'Get' and resource 'full data for a country', specifying it retrieves comprehensive information including name, capital, region, population, currency, exchange rate, timezones, and phone code. It distinguishes from siblings like list_countries (which likely lists countries without details) and search_countries (which likely searches by name rather than code).

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

Usage Guidelines3/5

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

The description implies usage by stating 'by ISO2 or ISO3 code', suggesting this tool is for looking up specific countries when codes are known. However, it doesn't explicitly state when to use this versus alternatives like list_countries (for browsing) or search_countries (for name-based searches), nor does it mention prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/APOGEOAPI/apogeoapi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server