diputados-actas-por-anio
Access and retrieve detailed legislative records of Argentine deputies for a specified year, providing comprehensive insights into their activities and decisions.
Instructions
Devuelve las actas de los diputados de un año específico
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| anio | Yes | EJ: 2025 |
Implementation Reference
- main.ts:498-544 (handler)MCP server.tool registration and inline handler function that validates input, calls getDiputadosActasPorAnio(anio), handles errors, and returns JSON response.server.tool( "diputados-actas-por-anio", "Devuelve las actas de los diputados de un año específico", { anio: z.number().describe("EJ: 2025"), }, async ({ anio }) => { if (anio === undefined) { return { content: [ { type: "text", text: "No se ha provisto el parámetro 'anio'", }, ], }; } try { const data = await getDiputadosActasPorAnio(anio); if (data.length === 0) { return { content: [ { type: "text", text: "No se encontraron actas para el año especificado", }, ], }; } return { content: [ { type: "text", text: JSON.stringify(data, null, 2), mimeType: "application/json", }, ], }; } catch (error) { return { content: [ { type: "text", text: "Error al obtener las actas de los diputados" }, ], }; } } );
- utils/functions.ts:64-68 (helper)Core helper function that fetches the actas data for diputados by year from the argentinadatos API.export const getDiputadosActasPorAnio = async (anio: number) => { const actas = await fetch(`${BASE_URL}/diputados/actas/${anio}`); const data = await actas.json(); return data; };
- main.ts:87-93 (schema)Tool schema definition in the initial MCP server capabilities declaration.{ name: "diputados-actas-por-anio", description: "Devuelve las actas de los diputados de un año específico", parameters: { anio: z.number().describe("EJ: 2025"), }, },