salud
Check the operational status and health of the Argentina Datos API to verify service availability and functionality.
Instructions
Devuelve el estado de la salud de la API
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.ts:581-612 (handler)The complete handler for the "salud" tool, registered with MCP server.tool. It calls the getSalud helper, checks the API status, and returns formatted text responses.server.tool( "salud", "Devuelve el estado de la salud de la API", {}, async ({}) => { try { const data = await getSalud(); if (data.estado === "Correcto") { return { content: [ { type: "text", text: "La API está funcionando correctamente" }, ], }; } else { return { content: [ { type: "text", text: "La API no está funcionando correctamente" }, ], }; } } catch (error) { return { content: [ { type: "text", text: "Error al obtener el estado de la salud de la API", }, ], }; } } );
- main.ts:99-103 (schema)Schema definition for the "salud" tool in the server's initial tools list, including name, description, and empty parameters schema.{ name: "salud", description: "Devuelve el estado de la salud de la API", parameters: {}, },
- utils/functions.ts:70-74 (helper)Helper function getSalud that fetches and returns the health status (estado) from the external API endpoint.export const getSalud = async () => { const salud = await fetch(`${BASE_URL}/estado`); const data = await salud.json(); return data; };