Skip to main content
Glama
APOGEOAPI
by APOGEOAPI

list_countries

Retrieve a paginated list of countries with customizable detail levels, from basic info to comprehensive data, for geographic reference and analysis.

Instructions

List all countries with pagination. Returns basic info by default — add fields=full for all data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (default: 1)
limitNoResults per page (default: 50, max: 100)
fieldsNoDetail level

Implementation Reference

  • The handler function for the list_countries tool which constructs the API request with pagination and field parameters.
    async ({ page, limit, fields }) => {
      const params = new URLSearchParams();
      if (page) params.set('page', String(page));
      if (limit) params.set('limit', String(limit));
      if (fields) params.set('fields', fields);
      const qs = params.toString() ? `?${params}` : '';
      const data = await apiGet(`/v1/api/geo/countries${qs}`);
      return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
    }
  • Registration of the list_countries tool within the McpServer instance.
    server.tool(
      'list_countries',
      'List all countries with pagination. Returns basic info by default — add fields=full for all data.',
      {
        page: z.number().int().positive().optional().describe('Page number (default: 1)'),
        limit: z.number().int().min(1).max(100).optional().describe('Results per page (default: 50, max: 100)'),
        fields: z.enum(['basic', 'standard', 'full']).optional().describe('Detail level'),
      },
      async ({ page, limit, fields }) => {
        const params = new URLSearchParams();
        if (page) params.set('page', String(page));
        if (limit) params.set('limit', String(limit));
        if (fields) params.set('fields', fields);
        const qs = params.toString() ? `?${params}` : '';
        const data = await apiGet(`/v1/api/geo/countries${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