Skip to main content
Glama

get_airports

Retrieve airports in Colombia with optional filtering by department. Returns airport names, cities, types, and IATA/OACI codes for travel planning or data analysis.

Instructions

Obtiene la lista de aeropuertos de Colombia. Puede filtrar por departamento.

Args:

  • department_id (number, opcional): ID del departamento para filtrar

Returns: Lista de aeropuertos con nombre, ciudad, tipo y códigos IATA/OACI.

Ejemplo de uso:

  • "¿Cuáles son los aeropuertos de Colombia?"

  • "Aeropuertos en Antioquia"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
department_idNoID del departamento para filtrar

Implementation Reference

  • Handler function that fetches airport data from the external API (api-colombia.com), optionally filtered by department_id. Processes the response to include relevant fields like name, city, IATA/OACI codes, coordinates, and returns formatted JSON text content.
    async ({ department_id }) => { try { let airports: any[]; if (department_id) { airports = await apiRequest<any[]>(`/Department/${department_id}/airports`); } else { airports = await apiRequest<any[]>("/Airport"); } const resultado = { total: airports.length, aeropuertos: airports.map(a => ({ id: a.id, nombre: a.name, ciudad: a.city?.name || "N/A", departamento: a.department?.name || "N/A", tipo: a.type, codigo_iata: a.iataCode, codigo_oaci: a.oaciCode, latitud: a.latitude, longitud: a.longitude, })), }; return { content: [ { type: "text", text: JSON.stringify(resultado, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error al obtener aeropuertos: ${error instanceof Error ? error.message : "Error desconocido"}`, }, ], }; } }
  • Zod input schema defining the optional department_id parameter for filtering airports by department.
    inputSchema: { department_id: z.number().int().optional().describe("ID del departamento para filtrar"), },
  • src/index.ts:684-753 (registration)
    Registration of the 'get_airports' tool on the MCP server, including metadata, description, input schema, annotations, and reference to the handler function.
    server.registerTool( "get_airports", { title: "Obtener Aeropuertos de Colombia", description: `Obtiene la lista de aeropuertos de Colombia. Puede filtrar por departamento. Args: - department_id (number, opcional): ID del departamento para filtrar Returns: Lista de aeropuertos con nombre, ciudad, tipo y códigos IATA/OACI. Ejemplo de uso: - "¿Cuáles son los aeropuertos de Colombia?" - "Aeropuertos en Antioquia"`, inputSchema: { department_id: z.number().int().optional().describe("ID del departamento para filtrar"), }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, }, async ({ department_id }) => { try { let airports: any[]; if (department_id) { airports = await apiRequest<any[]>(`/Department/${department_id}/airports`); } else { airports = await apiRequest<any[]>("/Airport"); } const resultado = { total: airports.length, aeropuertos: airports.map(a => ({ id: a.id, nombre: a.name, ciudad: a.city?.name || "N/A", departamento: a.department?.name || "N/A", tipo: a.type, codigo_iata: a.iataCode, codigo_oaci: a.oaciCode, latitud: a.latitude, longitud: a.longitude, })), }; return { content: [ { type: "text", text: JSON.stringify(resultado, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error al obtener aeropuertos: ${error instanceof Error ? error.message : "Error desconocido"}`, }, ], }; } } );

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/crexative/colombia-mcp-server'

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