Skip to main content
Glama
APOGEOAPI
by APOGEOAPI

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) }] };
      }
    );

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