list_holidays
Retrieve all Japanese national holidays for a specified year. Returns each holiday's date, Japanese name, and English weekday.
Instructions
List all Japanese national holidays for a given year.
Args: year: Western year (e.g. 2026).
Returns: dict with keys: - year: int - count: int - holidays: list of {date: 'YYYY-MM-DD', name_jp: str, weekday_en: str}
Examples: list_holidays(2026) → {"year": 2026, "count": 16, "holidays": [...]}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/japan_utils_mcp/server.py:341-377 (handler)The actual handler function for the 'list_holidays' tool. Uses jpholiday.year_holidays(year) to iterate over all national holidays in the given year, building a list of objects with date, name_jp, and weekday_en. Returns a dict with year, count, and holidays list.
def list_holidays(year: int) -> dict[str, Any]: """List all Japanese national holidays for a given year. Args: year: Western year (e.g. 2026). Returns: dict with keys: - year: int - count: int - holidays: list of {date: 'YYYY-MM-DD', name_jp: str, weekday_en: str} Examples: list_holidays(2026) → {"year": 2026, "count": 16, "holidays": [...]} """ holidays = [] for d, name_jp in jpholiday.year_holidays(year): holidays.append( { "date": d.isoformat(), "name_jp": name_jp, "weekday_en": [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday", ][d.weekday()], } ) return { "year": year, "count": len(holidays), "holidays": holidays, } - src/japan_utils_mcp/server.py:340-341 (registration)The @mcp.tool() decorator registers 'list_holidays' as an MCP tool on the FastMCP server instance.
@mcp.tool() def list_holidays(year: int) -> dict[str, Any]: - Docstring/type annotation defines the input schema (year: int -> dict[str, Any]) and the returned dict structure with year, count, and holidays list.
def list_holidays(year: int) -> dict[str, Any]: """List all Japanese national holidays for a given year. Args: year: Western year (e.g. 2026). Returns: dict with keys: - year: int - count: int - holidays: list of {date: 'YYYY-MM-DD', name_jp: str, weekday_en: str} Examples: list_holidays(2026) → {"year": 2026, "count": 16, "holidays": [...]} """