get_spain_holidays
Returns Spanish national public holidays for a specified year, including date and names in Spanish and English.
Instructions
Returns all Spanish national public holidays for a given year as a structured list. Each holiday includes { date: 'YYYY-MM-DD', name: string, name_en: string }. Returns 9 mandatory national holidays defined by Spanish law. Does not include regional holidays that vary by autonomous community.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes | Calendar year as a 4-digit integer. Example: 2026 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes | ||
| country | Yes | ||
| total_holidays | Yes | ||
| holidays | Yes |
Implementation Reference
- index.js:112-117 (registration)Registration of the 'get_spain_holidays' tool via server.registerTool(), including description, input/output schemas, and annotations.
server.registerTool("get_spain_holidays", { description: "Returns all Spanish national public holidays for a given year as a structured list. Each holiday includes { date: 'YYYY-MM-DD', name: string, name_en: string }. Returns 9 mandatory national holidays defined by Spanish law. Does not include regional holidays that vary by autonomous community.", inputSchema: { year: z.number().describe("Calendar year as a 4-digit integer. Example: 2026") }, outputSchema: { year: z.number(), country: z.string(), total_holidays: z.number(), holidays: z.array(z.object({ date: z.string(), name: z.string(), name_en: z.string() })) }, annotations: { title: "Get Spain Public Holidays", readOnlyHint: true, idempotentHint: true, openWorldHint: false } }, async ({ year }) => { - index.js:114-116 (schema)Input schema (year) and output schema (year, country, total_holidays, holidays array with date/name/name_en) for get_spain_holidays.
inputSchema: { year: z.number().describe("Calendar year as a 4-digit integer. Example: 2026") }, outputSchema: { year: z.number(), country: z.string(), total_holidays: z.number(), holidays: z.array(z.object({ date: z.string(), name: z.string(), name_en: z.string() })) }, annotations: { title: "Get Spain Public Holidays", readOnlyHint: true, idempotentHint: true, openWorldHint: false } - index.js:117-130 (handler)Handler function that returns 9 Spanish national public holidays (fixed-date, non-Easter-dependent) for a given year as a structured list.
}, async ({ year }) => { const holidays = [ { date: `${year}-01-01`, name: "Año Nuevo", name_en: "New Year's Day" }, { date: `${year}-01-06`, name: "Epifanía del Señor", name_en: "Epiphany" }, { date: `${year}-05-01`, name: "Fiesta del Trabajo", name_en: "Labour Day" }, { date: `${year}-08-15`, name: "Asunción de la Virgen", name_en: "Assumption of Mary" }, { date: `${year}-10-12`, name: "Fiesta Nacional de España", name_en: "Spanish National Day" }, { date: `${year}-11-01`, name: "Todos los Santos", name_en: "All Saints Day" }, { date: `${year}-12-06`, name: "Día de la Constitución Española", name_en: "Constitution Day" }, { date: `${year}-12-08`, name: "Inmaculada Concepción", name_en: "Immaculate Conception" }, { date: `${year}-12-25`, name: "Navidad", name_en: "Christmas Day" }, ]; return { content: [{ type: "text", text: JSON.stringify({ year, country: "Spain", total_holidays: holidays.length, holidays }) }] }; });