Skip to main content
Glama

getCountry

Retrieve comprehensive information about Colombia, including departments, regions, cities, tourist attractions, and general country data through the API Colombia service.

Instructions

Get information about a country

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'getCountry' tool. It fetches data about Colombia from the API Colombia service, formats it into a structured text response, handles errors, and returns an ApiColombiaResponse.
    export async function getCountry(): Promise<ApiColombiaResponse> {
        try {
            const apiUrl = process.env.API_COLOMBIA_URL || 'https://api-colombia.com/api/';
            const response = await fetch(`${apiUrl}v1/Country/Colombia`);
            
            if (!response.ok) {
                throw new Error(`HTTP error! status: ${response.status}`);
            }
            
            const countryData: CountryData = await response.json(); 
            
            const countryInfo = `
    Country: ${countryData.name}
    Capital: ${countryData.stateCapital}
    Population: ${countryData.population.toLocaleString()}
    Area: ${countryData.surface.toLocaleString()} km²
    Region: ${countryData.region} - ${countryData.subRegion}
    Languages: ${countryData.languages.join(', ')}
    Currency: ${countryData.currency} (${countryData.currencyCode} ${countryData.currencySymbol})
    Time Zone: ${countryData.timeZone}
    ISO Code: ${countryData.isoCode}
    Internet Domain: ${countryData.internetDomain}
    Phone Prefix: ${countryData.phonePrefix}
    Borders: ${countryData.borders.join(', ')}
    
    Description:
    ${countryData.description}
    
    Flag URLs:
    ${countryData.flags.join('\n')}
            `.trim();
            
            return {
                content: [{
                    type: 'text',
                    text: countryInfo
                }]
            };
            
        } catch (error) {
            const errorMessage = error instanceof Error ? error.message : ERROR_MESSAGES.UNKNOWN_ERROR;
            return {
                content: [{
                    type: 'text',
                    text: `${ERROR_MESSAGES.FETCH_ERROR}: ${errorMessage}`
                }]
            };
        }
    }
  • Registers the 'getCountry' tool in the tools array, specifying its name, description (from constants), and handler function.
    {
      name: TOOL_NAMES.GET_COUNTRY,
      description: TOOL_DESCRIPTIONS.GET_COUNTRY,
      handler: getCountry,
    },
  • Defines the schema/interface for tool configurations used in the registration, including handler signature expecting ApiColombiaResponse.
    export interface ToolConfig {
      name: string;
      description: string;
      handler: (...args: any[]) => Promise<ApiColombiaResponse>;
    }
  • Constants for tool names, including GET_COUNTRY used in tool registration.
    export const TOOL_NAMES = {
      GET_COUNTRY: 'getCountry',
      GET_REGIONS: 'getRegions',
      GET_REGION_BY_ID: 'getRegionById',
      GET_DEPARTMENTS_BY_REGION: 'getDepartmentsByRegion',
    } as const;
  • Constants for tool descriptions, including for GET_COUNTRY used in registration.
    export const TOOL_DESCRIPTIONS = {
      GET_COUNTRY: 'Get information about a country',
      GET_REGIONS: 'Get list of regions in Colombia',
      GET_REGION_BY_ID: 'Get detailed information about a specific region by ID',
      GET_DEPARTMENTS_BY_REGION: 'Get list of departments for a specific region by region ID',
    } as const;
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 of behavioral disclosure. It states 'Get information,' implying a read-only operation, but doesn't specify if it requires authentication, has rate limits, returns structured data, or handles errors. For a tool with zero annotation coverage, this is a significant gap in transparency about its behavior.

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: 'Get information about a country.' It is front-loaded with the core action and resource, with zero wasted words. This makes it highly concise and well-structured for its simple purpose.

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

Completeness2/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is incomplete. It doesn't explain what information is returned, how it's formatted, or any behavioral traits. While minimalism might suffice for basic tools, the lack of output details and behavioral context leaves gaps that could hinder effective use by an AI agent.

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?

The tool has 0 parameters, and schema description coverage is 100%, meaning there are no parameters to document. The description doesn't need to add parameter semantics beyond the schema. A baseline of 4 is appropriate as it avoids redundancy and the absence of parameters is clear from the context.

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

Purpose3/5

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

The description 'Get information about a country' clearly states the verb ('Get') and resource ('country'), making the purpose understandable. However, it lacks specificity about what type of information is retrieved (e.g., demographics, geography, statistics) and doesn't differentiate from potential sibling tools, which are unrelated to countries. This makes it vague but minimally viable.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for usage, or any exclusions. Given that sibling tools like 'getRegions' or 'getRegionById' might relate to geographic data, there's no indication of how this tool fits into that ecosystem, leaving usage unclear.

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/esneyder/apicolombia-mcp'

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