senado-actas-por-anio
Access and retrieve Senate session records from a specific year in Argentina using this tool, enabling efficient research and analysis of legislative activities.
Instructions
Devuelve las actas del senado de un año específico
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| anio | Yes | EJ: 2025 |
Implementation Reference
- main.ts:424-470 (handler)The main handler function for the 'senado-actas-por-anio' tool. It validates the 'anio' parameter, fetches data using getSenadoActasPorAnio, handles empty results and errors, and returns formatted JSON response.server.tool( "senado-actas-por-anio", "Devuelve las actas del senado 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 getSenadoActasPorAnio(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 del senado" }, ], }; } } );
- main.ts:74-80 (schema)Schema definition for the tool in the MCP server constructor, used for tool discovery.{ name: "senado-actas-por-anio", description: "Devuelve las actas del senado de un año específico", parameters: { anio: z.number().describe("EJ: 2025"), }, },
- utils/functions.ts:46-50 (helper)Helper function that performs the actual API fetch for senate actas by year from argentinadatos.com API.export const getSenadoActasPorAnio = async (anio: number) => { const actas = await fetch(`${BASE_URL}/senado/actas/${anio}`); const data = await actas.json(); return data; };