Skip to main content
Glama

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

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

With no annotations, the description carries full burden. It discloses pagination behavior and that it returns basic info by default, which is useful. However, it lacks details on rate limits, authentication needs, error handling, or response format structure, leaving gaps for a read operation.

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 two concise sentences with zero waste. It front-loads the core purpose and efficiently adds key usage detail about the 'fields' parameter, making it easy to scan and understand quickly.

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?

For a read-only tool with 3 parameters and no output schema, the description is adequate but incomplete. It covers pagination and detail levels, but lacks information on response format, error cases, or performance considerations, which could help an agent use 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?

Schema description coverage is 100%, so parameters are well-documented in the schema. The description adds value by explaining the 'fields' parameter's effect ('basic info by default — add fields=full for all data'), but doesn't provide additional context beyond what the schema already covers for 'page' and 'limit'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'List' and resource 'countries', specifying it includes pagination. It distinguishes from siblings like 'get_country' (singular) and 'search_countries' (filtered search), but doesn't explicitly contrast with all siblings like 'get_cities' or 'get_states'.

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 for retrieving all countries with pagination, but doesn't explicitly state when to use this vs. alternatives like 'search_countries' for filtered results or 'get_country' for single-country details. No guidance on prerequisites or exclusions is provided.

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