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.",
            },
          },
        },
      },
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool returns ('national and canton-specific holidays') and the optional canton filtering behavior. However, it doesn't disclose important behavioral traits like rate limits, authentication requirements, error conditions, or response format details that would be helpful for an agent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly concise and front-loaded in a single sentence that communicates all essential information: what the tool does, its parameters, and what it returns. There's zero wasted language or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a read-only data retrieval tool with no annotations and no output schema, the description provides adequate context about what the tool does and returns. It could be more complete by describing the response format or any limitations, but for a simple holiday lookup tool, it's reasonably complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description adds marginal value by mentioning the canton filtering is optional and providing example canton codes, but doesn't add significant semantic meaning beyond what's in the schema. This meets the baseline expectation when schema coverage is high.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get Swiss public holidays'), the resource ('public holidays'), and scope ('for a given year, optionally filtered by canton'). It distinguishes this tool from sibling tools like 'get_school_holidays' and 'is_holiday_today' by specifying it returns both national and canton-specific holidays for a given year.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool: when Swiss public holidays are needed for a specific year, with optional canton filtering. It doesn't explicitly mention when not to use it or name alternatives, but the context is sufficiently clear given the tool's specific domain.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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