Skip to main content
Glama

is_holiday_today

Check if today is a Swiss public holiday, optionally by canton, and get the holiday name if applicable.

Instructions

Check whether today is a Swiss public holiday, optionally for a specific canton. Returns the holiday name if it is one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cantonNoTwo-letter canton code (e.g. ZH, BE, GE). If omitted, checks nationwide holidays only.

Implementation Reference

  • The handler implementation for the `is_holiday_today` tool. It queries the OpenHolidays API for the current date, optionally filtering by canton, and returns whether it's a holiday.
    case "is_holiday_today": {
      const canton = args.canton as string | undefined;
      const today = new Date().toISOString().slice(0, 10); // YYYY-MM-DD
    
      const params: Record<string, string> = {
        countryIsoCode: "CH",
        languageIsoCode: "EN",
        validFrom: today,
        validTo: today,
      };
      if (canton) {
        params.subdivisionCode = toSubdivisionCode(canton);
      }
    
      const url = buildUrl(`${BASE}/PublicHolidays`, params);
      const data = await fetchJSON<Holiday[]>(url);
    
      if (data.length === 0) {
        return JSON.stringify({
          date: today,
          is_holiday: false,
          canton: canton ?? "all",
        });
      }
    
      // Return the first (or nationwide) match
      const nationwide = data.find((h) => h.nationwide);
      const match = nationwide ?? data[0];
      return JSON.stringify({
        date: today,
        is_holiday: true,
        holiday: extractName(match.name),
        type: match.type,
        nationwide: match.nationwide,
        canton: canton ?? "all",
      });
    }
  • The tool registration and schema definition for `is_holiday_today`.
      name: "is_holiday_today",
      description:
        "Check whether today is a Swiss public holiday, optionally for a specific canton. Returns the holiday name if it is one.",
      inputSchema: {
        type: "object",
        properties: {
          canton: {
            type: "string",
            description:
              "Two-letter canton code (e.g. ZH, BE, GE). If omitted, checks nationwide holidays only.",
          },
        },
      },
    },
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. It discloses the return behavior ('Returns the holiday name if it is one') and implies a read-only operation. However, it lacks details on error handling, rate limits, or authentication requirements 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 with two sentences that each earn their place. The first sentence states the purpose and scope, while the second explains the return behavior. No wasted words 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?

For a simple read-only tool with one optional parameter and no output schema, the description is reasonably complete. It covers purpose, parameter context, and return behavior. However, without annotations or output schema, additional details about error cases or response format would improve completeness.

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?

Schema description coverage is 100%, so the schema already fully documents the optional 'canton' parameter. The description adds marginal value by mentioning 'optionally for a specific canton' but doesn't provide additional semantics beyond what's in the schema. Baseline 3 is appropriate.

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 tool's purpose with a specific verb ('Check') and resource ('Swiss public holiday'), including optional canton-specific filtering. It distinguishes from sibling tools like 'get_public_holidays' by focusing on today's status rather than a list of holidays.

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 for when to use this tool ('Check whether today is a Swiss public holiday') and implies an alternative ('get_public_holidays' for broader holiday data). However, it doesn't explicitly state when not to use it or compare directly with siblings.

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