get_regions
Retrieve Colombia's six natural regions with IDs, names, and descriptions for geographical reference and tourism planning.
Instructions
Obtiene las 6 regiones naturales de Colombia: Caribe, Pacífico, Orinoquía, Amazonía, Andina e Insular.
Returns: Lista de regiones con id, nombre y descripción.
Ejemplo de uso:
"¿Cuáles son las regiones de Colombia?"
"Dame información sobre las regiones naturales"
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:93-142 (registration)Registration of the 'get_regions' tool using server.registerTool, including title, description, empty input schema, annotations, and inline handler function.server.registerTool( "get_regions", { title: "Obtener Regiones de Colombia", description: `Obtiene las 6 regiones naturales de Colombia: Caribe, Pacífico, Orinoquía, Amazonía, Andina e Insular. Returns: Lista de regiones con id, nombre y descripción. Ejemplo de uso: - "¿Cuáles son las regiones de Colombia?" - "Dame información sobre las regiones naturales"`, inputSchema: {}, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, }, async () => { try { const regions = await apiRequest<Region[]>("/Region"); const resultado = regions.map(r => ({ id: r.id, nombre: r.name, descripcion: r.description, })); return { content: [ { type: "text", text: JSON.stringify(resultado, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error al obtener regiones: ${error instanceof Error ? error.message : "Error desconocido"}`, }, ], }; } } );
- src/index.ts:114-141 (handler)The handler function that fetches the list of regions from the API endpoint '/Region', maps them to a simplified format, and returns as text content or an error message.try { const regions = await apiRequest<Region[]>("/Region"); const resultado = regions.map(r => ({ id: r.id, nombre: r.name, descripcion: r.description, })); return { content: [ { type: "text", text: JSON.stringify(resultado, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error al obtener regiones: ${error instanceof Error ? error.message : "Error desconocido"}`, }, ], }; } }
- src/index.ts:95-112 (schema)Schema configuration for the get_regions tool, including title, detailed description, empty inputSchema (no parameters required), and annotations indicating read-only, idempotent behavior.{ title: "Obtener Regiones de Colombia", description: `Obtiene las 6 regiones naturales de Colombia: Caribe, Pacífico, Orinoquía, Amazonía, Andina e Insular. Returns: Lista de regiones con id, nombre y descripción. Ejemplo de uso: - "¿Cuáles son las regiones de Colombia?" - "Dame información sobre las regiones naturales"`, inputSchema: {}, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, },
- src/index.ts:44-48 (helper)TypeScript interface defining the structure of a Region object, used in the apiRequest generic type for get_regions.interface Region { id: number; name: string; description: string; }