get-feriados
Access and retrieve public holidays in Argentina for any year using the MCP Argentina Datos API. Simplify planning and scheduling with accurate holiday data.
Instructions
Devuelve los feriados del año
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.ts:110-137 (handler)Handler for the 'get-feriados' tool that fetches holidays for the current year using getFeriados() and returns a JSON response or an error message.server.tool("get-feriados", "Devuelve los feriados del año", {}, async ({}) => { try { const data = await getFeriados(); if (data.length === 0) { return { content: [ { type: "text", text: "No se encontraron feriados para el año actual", }, ], }; } 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)The core helper function getFeriados that performs the API fetch to retrieve holidays (feriados) data from argentinadatos.com for the specified year (defaults to current year).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:26-29 (schema)Schema definition for the 'get-feriados' tool in the MCP server tools list, specifying no input parameters.name: "get-feriados", description: "Devuelve los feriados del año", parameters: {}, },
- main.ts:110-137 (registration)Registration of the 'get-feriados' tool using server.tool, including description, empty schema, and handler.server.tool("get-feriados", "Devuelve los feriados del año", {}, async ({}) => { try { const data = await getFeriados(); if (data.length === 0) { return { content: [ { type: "text", text: "No se encontraron feriados para el año actual", }, ], }; } 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" }], }; } });