get_school_holidays
Retrieve Swiss school holiday dates for any year, with optional canton filtering. Provides start and end dates for holiday periods across Switzerland.
Instructions
Get Swiss school holidays for a given year, optionally filtered by canton. Returns holiday periods (start/end dates) by canton.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes | Year (e.g. 2026) | |
| canton | No | Two-letter canton code (e.g. ZH, BE, GE, BS, TI). If omitted, returns school holidays for all cantons. |
Implementation Reference
- src/modules/holidays.ts:148-173 (handler)The handler logic for 'get_school_holidays' which calls the OpenHolidays API for school holidays.
case "get_school_holidays": { const year = args.year as number; const canton = args.canton as string | undefined; const params: Record<string, string> = { countryIsoCode: "CH", languageIsoCode: "EN", validFrom: `${year}-01-01`, validTo: `${year}-12-31`, }; if (canton) { params.subdivisionCode = toSubdivisionCode(canton); } const url = buildUrl(`${BASE}/SchoolHolidays`, params); const data = await fetchJSON<Holiday[]>(url); const holidays = data.map(compactHoliday); return JSON.stringify({ year, canton: canton ?? "all", count: holidays.length, holidays, source: "openholidaysapi.org", }); } - src/modules/holidays.ts:49-65 (schema)Tool registration and input schema for 'get_school_holidays'.
{ name: "get_school_holidays", description: "Get Swiss school holidays for a given year, optionally filtered by canton. Returns holiday periods (start/end dates) by canton.", inputSchema: { type: "object", required: ["year"], properties: { year: { type: "number", description: "Year (e.g. 2026)" }, canton: { type: "string", description: "Two-letter canton code (e.g. ZH, BE, GE, BS, TI). If omitted, returns school holidays for all cantons.", }, }, }, },