Skip to main content
Glama
europarcel
by europarcel

Get Countries

getCountries

Retrieve a list of all available countries along with their currency and language information for shipping and logistics operations.

Instructions

Retrieves all available countries with their currency and language information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registers the 'getCountries' tool on the MCP server. The handler retrieves the API key from async context, creates an API client, calls client.getCountries(), and returns a formatted response listing country names, currency, and language.
    export function registerGetCountriesTool(server: McpServer): void {
      // Create API client instance
    
      // Register getCountries tool
      server.registerTool(
        "getCountries",
        {
          title: "Get Countries",
          description:
            "Retrieves all available countries with their currency and language information",
          inputSchema: {},
        },
        async () => {
          // Get API key from async context
          const apiKey = apiKeyStorage.getStore();
    
          if (!apiKey) {
            return {
              content: [
                {
                  type: "text",
                  text: "Error: X-API-KEY header is required",
                },
              ],
            };
          }
    
          // Create API client with customer's API key
          const client = new EuroparcelApiClient(apiKey);
    
          try {
            logger.info("Fetching countries");
    
            const countries = await client.getCountries();
    
            logger.info(`Retrieved ${countries.length} countries`);
    
            let formattedResponse = `Found ${countries.length} countries:\n\n`;
    
            countries.forEach((country) => {
              formattedResponse += `${country.name} (${country.country_code})\n`;
              formattedResponse += `  Currency: ${country.currency}\n`;
              formattedResponse += `  Language: ${country.language}\n\n`;
            });
    
            return {
              content: [
                {
                  type: "text",
                  text: formattedResponse,
                },
              ],
            };
          } catch (error: any) {
            logger.error("Failed to fetch countries", error);
    
            return {
              content: [
                {
                  type: "text",
                  text: `Error fetching countries: ${error.message || "Unknown error"}`,
                },
              ],
            };
          }
        },
      );
    
      logger.info("getCountries tool registered successfully");
    }
  • Type definition for Country - the return type used by the getCountries tool and API client.
    export interface Country {
      country_code: string;
      name: string;
      currency: string;
      language: string;
    }
  • Registration aggregator that calls registerGetCountriesTool alongside other location tools.
    export function registerLocationTools(server: McpServer): void {
      logger.info("Registering location tools...");
    
      // Register all location-related tools
      registerGetCountriesTool(server);
      registerGetCountiesTool(server);
      registerGetLocalitiesTool(server);
      registerGetCarriersTool(server);
      registerGetServicesTool(server);
      registerGetFixedLocationsTool(server);
      registerGetFixedLocationByIdTool(server);
    
      logger.info("All location tools registered successfully");
  • API client helper that makes the actual HTTP GET request to /locations/countries and returns the list of Country objects.
    async getCountries(): Promise<Country[]> {
      const response = await this.client.get<Country[]>("/locations/countries");
      return response.data;
    }
Behavior2/5

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

Description only states what is retrieved but does not disclose behavioral traits such as data freshness, sorting order, or any limitations. With no annotations available, the description carries the full burden but fails to provide meaningful behavioral context.

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?

Single, clear sentence that is front-loaded with the verb and resource. No unnecessary words; every part contributes to understanding the tool's functionality.

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?

While the description covers the basic purpose, for a list retrieval tool with no output schema, it lacks details on output format, ordering, or any behavioral guarantees. Somewhat complete but could be improved with minor additions.

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?

Input schema has zero parameters and full coverage. Description does not need to add parameter details; it states what the output contains, which is sufficient given the lack of parameters. Baseline of 4 is appropriate.

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?

Description explicitly states it retrieves all available countries with currency and language information. Verb 'retrieves' and resource 'countries' are clear, and the additional detail on included fields distinguishes it from sibling tools like getCounties or getLocalities.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives such as getLocalities or search fields. No prerequisites or context provided, leaving the agent to infer when it is appropriate to call getCountries.

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/europarcel/mcp-docker'

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