Skip to main content
Glama

get_public_holidays

Retrieve Swiss public holidays for any year, with optional canton filtering to get national and regional holiday data.

Instructions

Get Swiss public holidays for a given year, optionally filtered by canton (e.g. ZH, BE, GE). Returns national and canton-specific holidays.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYesYear (e.g. 2026)
cantonNoTwo-letter canton code (e.g. ZH, BE, GE, BS, TI). If omitted, returns all Swiss holidays.

Implementation Reference

  • Handler logic for the get_public_holidays tool.
    case "get_public_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}/PublicHolidays`, 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",
      });
    }
  • Tool definition and input schema for get_public_holidays.
    export const holidaysTools = [
      {
        name: "get_public_holidays",
        description:
          "Get Swiss public holidays for a given year, optionally filtered by canton (e.g. ZH, BE, GE). Returns national and canton-specific holidays.",
        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 all Swiss holidays.",
            },
          },
        },
      },

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vikramgorla/mcp-swiss'

If you have feedback or need assistance with the MCP directory API, please join our Discord server