get_france_holidays
Retrieves all French national public holidays for a given year, with dynamic calculation of Easter-dependent holidays using the Anonymous Gregorian algorithm.
Instructions
Returns all French national public holidays for a given year. Easter-dependent holidays (Easter Monday, Ascension, Whit Monday) are dynamically calculated using the Anonymous Gregorian algorithm. Returns 11 mandatory holidays defined by French law.
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:132-163 (handler)The get_france_holidays tool handler function. It registers the tool with server.registerTool, receives a 'year' parameter, computes Easter-dependent holidays using the Anonymous Gregorian algorithm, and returns 11 French national holidays.
// ── 6. Get France Holidays ── server.registerTool("get_france_holidays", { description: "Returns all French national public holidays for a given year. Easter-dependent holidays (Easter Monday, Ascension, Whit Monday) are dynamically calculated using the Anonymous Gregorian algorithm. Returns 11 mandatory holidays defined by French law.", 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 France Public Holidays", readOnlyHint: true, idempotentHint: true, openWorldHint: false } }, async ({ year }) => { const a = year % 19, b = Math.floor(year / 100), c = year % 100; const d = Math.floor(b / 4), e = b % 4, f = Math.floor((b + 8) / 25); const g = Math.floor((b - f + 1) / 3), h = (19 * a + b - d - g + 15) % 30; const i = Math.floor(c / 4), k = c % 4, l = (32 + 2 * e + 2 * i - h - k) % 7; const m = Math.floor((a + 11 * h + 22 * l) / 451); const month = Math.floor((h + l - 7 * m + 114) / 31); const day = ((h + l - 7 * m + 114) % 31) + 1; const easter = new Date(year, month - 1, day); const addDays = (date, days) => { const d = new Date(date); d.setDate(d.getDate() + days); return d; }; const fmt = (d) => d.toISOString().split("T")[0]; const holidays = [ { date: `${year}-01-01`, name: "Jour de l'An", name_en: "New Year's Day" }, { date: fmt(addDays(easter, 1)), name: "Lundi de Pâques", name_en: "Easter Monday" }, { date: `${year}-05-01`, name: "Fête du Travail", name_en: "Labour Day" }, { date: `${year}-05-08`, name: "Victoire 1945", name_en: "Victory in Europe Day" }, { date: fmt(addDays(easter, 39)), name: "Ascension", name_en: "Ascension Day" }, { date: fmt(addDays(easter, 50)), name: "Lundi de Pentecôte", name_en: "Whit Monday" }, { date: `${year}-07-14`, name: "Fête Nationale", name_en: "Bastille Day" }, { date: `${year}-08-15`, name: "Assomption", name_en: "Assumption of Mary" }, { date: `${year}-11-01`, name: "Toussaint", name_en: "All Saints Day" }, { date: `${year}-11-11`, name: "Armistice", name_en: "Armistice Day" }, { date: `${year}-12-25`, name: "Noël", name_en: "Christmas Day" }, ]; return { content: [{ type: "text", text: JSON.stringify({ year, country: "France", total_holidays: holidays.length, holidays }) }] }; }); - index.js:132-138 (registration)Registration of the get_france_holidays tool via server.registerTool, including description, input schema (year), output schema, and annotations.
// ── 6. Get France Holidays ── server.registerTool("get_france_holidays", { description: "Returns all French national public holidays for a given year. Easter-dependent holidays (Easter Monday, Ascension, Whit Monday) are dynamically calculated using the Anonymous Gregorian algorithm. Returns 11 mandatory holidays defined by French law.", 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 France Public Holidays", readOnlyHint: true, idempotentHint: true, openWorldHint: false } }, async ({ year }) => { - index.js:135-136 (schema)Input and output schemas for get_france_holidays: input expects a 4-digit year; output returns year, country, total_holidays, and an array of holidays with date, name, and name_en fields.
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() })) },