eventos-presidenciales
Access and retrieve detailed information about presidential events in Argentina through the MCP Argentina Datos API.
Instructions
Devuelve los eventos presidenciales
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.ts:187-211 (handler)MCP tool handler for 'eventos-presidenciales'. Calls getEventosPresidenciales() and returns the JSON data or an error message.server.tool( "eventos-presidenciales", "Devuelve los eventos presidenciales", {}, async ({}) => { try { const data = await getEventosPresidenciales(); return { content: [ { type: "text", text: JSON.stringify(data, null, 2), mimeType: "application/json", }, ], }; } catch (error) { return { content: [ { type: "text", text: "Error al obtener los eventos presidenciales" }, ], }; } } );
- utils/functions.ts:8-12 (helper)Helper function that fetches presidential events data from the Argentina Datos API endpoint.export const getEventosPresidenciales = async () => { const eventos = await fetch(`${BASE_URL}/eventos/presidenciales/`); const data = await eventos.json(); return data; };
- main.ts:37-41 (schema)Static tool schema declaration listing the tool name, description, and parameters in the MCP server constructor.{ name: "eventos-presidenciales", description: "Devuelve los eventos presidenciales", parameters: {}, },
- main.ts:187-211 (registration)Registers the 'eventos-presidenciales' tool with its handler on the MCP server.server.tool( "eventos-presidenciales", "Devuelve los eventos presidenciales", {}, async ({}) => { try { const data = await getEventosPresidenciales(); return { content: [ { type: "text", text: JSON.stringify(data, null, 2), mimeType: "application/json", }, ], }; } catch (error) { return { content: [ { type: "text", text: "Error al obtener los eventos presidenciales" }, ], }; } } );