Skip to main content
Glama

getRegions

Retrieve a complete list of Colombia's administrative regions to access geographical and administrative data for research, travel planning, or data analysis purposes.

Instructions

Get list of regions in Colombia

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'getRegions' tool. Fetches list of regions from the Colombia API, formats the data with emojis and details (ID, name, description, departments), adds a header, handles errors, and returns a formatted ApiColombiaResponse.
    export async function getRegions(): Promise<ApiColombiaResponse> {
        try {
            const apiUrl = process.env.API_COLOMBIA_URL || 'https://api-colombia.com/api/';
            const response = await fetch(`${apiUrl}v1/Region`);
            
            if (!response.ok) {
                throw new Error(`HTTP error! status: ${response.status}`);
            }
            
            const regionsData: RegionData[] = await response.json();
            
            // Format the regions data into a readable text format
            const regionsInfo = regionsData.map(region => `
    ๐ŸŒŽ REGIร“N: ${region.name}
    ๐Ÿ“ ID: ${region.id}
    ๐Ÿ“ Descripciรณn: ${region.description}
    ${region.departments ? `๐Ÿ›๏ธ Departamentos: ${region.departments.join(', ')}` : '๐Ÿ›๏ธ Departamentos: No especificados'}
    ${'โ”€'.repeat(80)}
            `).join('\n');
            
            const headerInfo = `
    ๐Ÿ‡จ๐Ÿ‡ด REGIONES DE COLOMBIA
    Total de regiones: ${regionsData.length}
    ${'โ•'.repeat(80)}
            `;
            
            return {
                content: [{
                    type: 'text',
                    text: (headerInfo + regionsInfo).trim()
                }]
            };
            
        } 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 'getRegions' tool within the MCP tools configuration array, linking the name, description from constants, and the handler function.
    {
      name: TOOL_NAMES.GET_REGIONS,
      description: TOOL_DESCRIPTIONS.GET_REGIONS,
      handler: getRegions,
    },
  • Defines the ToolConfig interface used for structuring the registration of all MCP tools, including input name, description, and handler signature with ApiColombiaResponse return.
    export interface ToolConfig {
      name: string;
      description: string;
      handler: (...args: any[]) => Promise<ApiColombiaResponse>;
    }
  • Type definition for the output response format of the getRegions tool and other tools, specifying a content array of text blocks.
    type ApiColombiaResponse = {
        content:Array<{
            type:'text',
            text:string,
        }>
    }
    export type { ApiColombiaResponse }
  • Defines constant tool names used in registration, including GET_REGIONS: 'getRegions' which is the tool name.
    export const TOOL_NAMES = {
      GET_COUNTRY: 'getCountry',
      GET_REGIONS: 'getRegions',
      GET_REGION_BY_ID: 'getRegionById',
      GET_DEPARTMENTS_BY_REGION: 'getDepartmentsByRegion',
    } as const;
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Get list') but doesn't describe traits like whether this is a read-only operation, if it requires authentication, rate limits, or what the return format looks like (e.g., list structure, fields included). This is inadequate for a tool with zero annotation coverage.

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 that directly states the tool's purpose without any unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain behavioral aspects like safety, authentication, or return values, which are crucial for an agent to use the tool effectively. For a simple list tool, more context on output format or constraints would improve completeness.

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 input schema has 0 parameters with 100% coverage, so the schema fully documents that no inputs are required. The description adds no parameter information, which is acceptable since there are no parameters to explain. Baseline is 4 for 0 parameters, as the description doesn't need to compensate for any gaps.

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 ('Get') and resource ('list of regions in Colombia'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'getRegionById' (which fetches a single region) or 'getDepartmentsByRegion' (which fetches departments within regions), missing full sibling distinction.

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 that 'getRegionById' is for retrieving a specific region by ID, 'getDepartmentsByRegion' is for departments within regions, or 'getCountry' might provide broader country info, leaving the agent to infer usage from tool names alone.

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