eventos-presidenciales
Access presidential events data from Argentina to track official activities and engagements through the Argentina Datos API.
Instructions
Devuelve los eventos presidenciales
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "eventos-presidenciales"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.ts:187-211 (handler)Handler function registered with MCP server for the 'eventos-presidenciales' tool. It calls getEventosPresidenciales() and formats the response as JSON or handles errors.
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 performs the actual API fetch for presidential events from https://api.argentinadatos.com/v1/eventos/presidenciales/
export const getEventosPresidenciales = async () => { const eventos = await fetch(`${BASE_URL}/eventos/presidenciales/`); const data = await eventos.json(); return data; }; - main.ts:37-41 (schema)Tool schema definition in the MCP server's tools list for discovery, specifying name, description, and empty parameters.
{ name: "eventos-presidenciales", description: "Devuelve los eventos presidenciales", parameters: {}, }, - main.ts:187-211 (registration)Registration of the 'eventos-presidenciales' tool with the MCP server using server.tool(), including schema and handler.
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" }, ], }; } } );