Skip to main content
Glama
vivek081166

japan-utils-mcp

is_holiday

Determine if a date is a Japanese national holiday. Returns holiday name, weekday in Japanese and English.

Instructions

Check whether a date is a Japanese national holiday (祝日).

Args: date_str: Date in 'YYYY-MM-DD', 'YYYY/MM/DD', or 'YYYYMMDD' format.

Returns: dict with keys: - date: str (normalized 'YYYY-MM-DD') - is_holiday: bool - name_jp: str | None (holiday name in Japanese, if applicable) - weekday_jp: str (e.g. '月', '火', ...) - weekday_en: str (e.g. 'Monday')

Examples: is_holiday("2026-05-03") → {"is_holiday": True, "name_jp": "憲法記念日", ...} is_holiday("2026-05-04") → {"is_holiday": True, "name_jp": "みどりの日", ...} is_holiday("2026-05-08") → {"is_holiday": False, "name_jp": None, ...}

Notes: - Covers national holidays only (祝日 designated by the 国民の祝日に関する法律). Does not cover company-specific or regional observances. - 振替休日 (substitute holidays) are correctly identified.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
date_strYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'is_holiday' tool. Decorated with @mcp.tool(), accepts a date string (YYYY-MM-DD, YYYY/MM/DD, or YYYYMMDD), parses it via _parse_date helper, checks against the jpholiday library, and returns a dict with is_holiday, name_jp, weekday_jp, weekday_en.
    @mcp.tool()
    def is_holiday(date_str: str) -> dict[str, Any]:
        """Check whether a date is a Japanese national holiday (祝日).
    
        Args:
            date_str: Date in 'YYYY-MM-DD', 'YYYY/MM/DD', or 'YYYYMMDD' format.
    
        Returns:
            dict with keys:
                - date: str (normalized 'YYYY-MM-DD')
                - is_holiday: bool
                - name_jp: str | None (holiday name in Japanese, if applicable)
                - weekday_jp: str (e.g. '月', '火', ...)
                - weekday_en: str (e.g. 'Monday')
    
        Examples:
            is_holiday("2026-05-03") → {"is_holiday": True, "name_jp": "憲法記念日", ...}
            is_holiday("2026-05-04") → {"is_holiday": True, "name_jp": "みどりの日", ...}
            is_holiday("2026-05-08") → {"is_holiday": False, "name_jp": None, ...}
    
        Notes:
            - Covers national holidays only (祝日 designated by the 国民の祝日に関する法律).
              Does not cover company-specific or regional observances.
            - 振替休日 (substitute holidays) are correctly identified.
        """
        d = _parse_date(date_str)
        name = jpholiday.is_holiday_name(d)
        weekday_jp = "月火水木金土日"[d.weekday()]
        weekday_en = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"][
            d.weekday()
        ]
        return {
            "date": d.isoformat(),
            "is_holiday": name is not None,
            "name_jp": name,
            "weekday_jp": weekday_jp,
            "weekday_en": weekday_en,
        }
  • Registration of the 'is_holiday' tool via the @mcp.tool() decorator on line 300. FastMCP automatically registers tool functions decorated with @mcp.tool().
    @mcp.tool()
    def is_holiday(date_str: str) -> dict[str, Any]:
  • Return schema for is_holiday: dict with keys 'date' (str), 'is_holiday' (bool), 'name_jp' (str | None), 'weekday_jp' (str), 'weekday_en' (str).
            - date: str (normalized 'YYYY-MM-DD')
            - is_holiday: bool
            - name_jp: str | None (holiday name in Japanese, if applicable)
            - weekday_jp: str (e.g. '月', '火', ...)
            - weekday_en: str (e.g. 'Monday')
    
    Examples:
        is_holiday("2026-05-03") → {"is_holiday": True, "name_jp": "憲法記念日", ...}
        is_holiday("2026-05-04") → {"is_holiday": True, "name_jp": "みどりの日", ...}
        is_holiday("2026-05-08") → {"is_holiday": False, "name_jp": None, ...}
    
    Notes:
        - Covers national holidays only (祝日 designated by the 国民の祝日に関する法律).
          Does not cover company-specific or regional observances.
        - 振替休日 (substitute holidays) are correctly identified.
    """
    d = _parse_date(date_str)
    name = jpholiday.is_holiday_name(d)
    weekday_jp = "月火水木金土日"[d.weekday()]
    weekday_en = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"][
        d.weekday()
    ]
    return {
        "date": d.isoformat(),
        "is_holiday": name is not None,
        "name_jp": name,
        "weekday_jp": weekday_jp,
        "weekday_en": weekday_en,
    }
  • Helper function _parse_date used by is_holiday to parse date strings in YYYY-MM-DD, YYYY/MM/DD, or YYYYMMDD formats into a datetime.date object.
    def _parse_date(text: str) -> date:
        """Accept 'YYYY-MM-DD', 'YYYY/MM/DD', or 'YYYYMMDD'."""
        s = text.strip()
        for fmt in ("%Y-%m-%d", "%Y/%m/%d", "%Y%m%d"):
            try:
                return datetime.strptime(s, fmt).date()
            except ValueError:
                continue
        raise ValueError(
            f"Could not parse date {text!r}. Use YYYY-MM-DD, YYYY/MM/DD, or YYYYMMDD."
        )
Behavior3/5

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

No annotations are provided, so the description carries the burden. It explains what types of holidays are covered and that substitute holidays are handled, but does not explicitly state that it is read-only or mention any potential side effects. For a simple lookup, this is adequate.

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 well-structured with clear sections (Args, Returns, Examples, Notes) and is concise. Every sentence adds value, and the examples are particularly helpful.

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

Completeness5/5

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

Given the tool's simplicity (1 parameter, no annotations, output schema present but described in detail), the description provides all necessary context: input format, return structure with key types, examples, and scope notes. It is fully complete.

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

Parameters5/5

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

The input schema has 0% description coverage for the single parameter 'date_str', but the tool description lists three accepted date formats (YYYY-MM-DD, YYYY/MM/DD, YYYYMMDD). This adds significant value beyond the bare schema type 'string'.

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 it checks whether a date is a Japanese national holiday, using a specific verb ('check') and resource ('date'). It distinguishes from sibling tools like 'list_holidays' by focusing on single-date validation.

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 includes notes on scope (national only, substitute holidays) but does not explicitly contrast with sibling tools like 'list_holidays' for when to use each. However, the single-date focus and examples make purpose clear.

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/vivek081166/japan-utils-mcp'

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