get-feriados-timeframe
Retrieve official holidays for a specific year in Argentina to plan schedules, avoid conflicts, and ensure compliance with national observances.
Instructions
Devuelve los feriados de un año específico pasado por parámetro
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"year": "<year>"
},
"name": "get-feriados-timeframe"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes | EJ: 2025 |
Implementation Reference
- main.ts:140-184 (handler)Handler implementation for the 'get-feriados-timeframe' tool. It takes a 'year' parameter, calls the helper getFeriados(year), handles errors, and returns JSON data or error messages.
server.tool( "get-feriados-timeframe", "Devuelve los feriados de un año específico pasado por parámetro", { year: z.number().describe("EJ: 2025"), }, async ({ year }) => { if (year === undefined) { return { content: [ { type: "text", text: "No se ha provisto el parámetro 'year'", }, ], }; } try { const data = await getFeriados(year); if (data.length === 0) { return { content: [ { type: "text", text: "No se encontraron feriados 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 los feriados" }], }; } } ); - utils/functions.ts:2-6 (helper)Core helper function getFeriados that performs the API fetch for feriados (holidays) data for a given year from argentinadatos.com API.
export const getFeriados = async (year = new Date().getFullYear()) => { const feriados = await fetch(`${BASE_URL}/feriados/${year}`); const data = await feriados.json(); return data; }; - main.ts:30-36 (schema)Schema definition for the tool in the server's tools list, declaring name, description, and input parameters.
{ name: "get-feriados-timeframe", description: "Devuelve los feriados del año", parameters: { year: z.number().describe("EJ: 2025"), }, }, - main.ts:141-145 (registration)Tool registration call with name, description, and Zod schema for input validation within the server.tool method.
"get-feriados-timeframe", "Devuelve los feriados de un año específico pasado por parámetro", { year: z.number().describe("EJ: 2025"), }, - utils/functions.ts:1-1 (helper)BASE_URL constant used by getFeriados to construct the API endpoint.
const BASE_URL = "https://api.argentinadatos.com/v1";