# Paņem brīvdienu

> Latvian public holidays, days off and annual leave for 2026 and 2027, computed from Latvian law. An MCP server and a JSON API over the same code. Read-only; nothing is stored.

The calendar assumes a Monday-to-Friday workweek. Leave planning counts **working days**; the annual leave estimate is in **calendar days excluding statutory holidays**, a different unit. The [2026 workday transfers](https://likumi.lv/ta/id/361161-par-darba-dienu-parcelsanu-2026-gada) bind only specified state-funded institutions, so they are opt-in: `apply_transfers=true`.

## Pages

- [Working days calendar 2026](https://panembrivdienu.lv/working-days-calendar-2026) and [2027](https://panembrivdienu.lv/working-days-calendar-2027): working days, working hours and public holidays by month, pre-holiday days and workday transfers. The same pages in Latvian: [darba dienu kalendārs 2026](https://panembrivdienu.lv/darba-dienu-kalendars-2026) and [2027](https://panembrivdienu.lv/darba-dienu-kalendars-2027).
- [Public holidays in Latvia 2026](https://panembrivdienu.lv/public-holidays-latvia-2026) and [2027](https://panembrivdienu.lv/public-holidays-latvia-2027): every public holiday with its date and weekday, the holidays that fall on a weekend, and workday transfers. The same pages in Latvian: [svētku dienas 2026](https://panembrivdienu.lv/svetku-dienas-2026) and [2027](https://panembrivdienu.lv/svetku-dienas-2027).

## MCP

Remote streamable-HTTP endpoint: `https://panembrivdienu.valksor.tools/mcp` (stateless, no account needed).

- Claude Code: `claude mcp add --transport http panembrivdienu https://panembrivdienu.valksor.tools/mcp`
- Cursor / Cline: `{"mcpServers": {"panembrivdienu": {"url": "https://panembrivdienu.valksor.tools/mcp"}}}`
- VS Code (`.vscode/mcp.json`): `{"servers": {"panembrivdienu": {"type": "http", "url": "https://panembrivdienu.valksor.tools/mcp"}}}`
- stdio-only clients: `{"mcpServers": {"panembrivdienu": {"command": "npx", "args": ["-y", "mcp-remote", "https://panembrivdienu.valksor.tools/mcp"]}}}`

Tools:

- `latvia_holidays(year, apply_transfers?)`: holiday dates with Latvian and English names.
- `latvia_calendar_statistics(year, apply_transfers?)`: working days, weekend days, holidays, days off, working hours and a per-month breakdown with pre-holiday days.
- `latvia_plan_time_off(year, pto_days, apply_transfers?, employment_start_date?, extra_days_off?)`: up to ten breaks, best first, where leave days bridge weekends and holidays. Each uses at most `pto_days` leave days on its own and holds a holiday or other day off on a weekday; a week that only joins two weekends is not listed. Leave is never before today in Latvia or before `employment_start_date`. Each break has `pto_hours`, the working hours of its leave days, assuming a full-time 8-hour day (7 hours on a pre-holiday day).
- `latvia_leave_entitlement(employment_start_date, year, fte_percentage, annual_base, birth_date?)`: annual leave estimate. The legal minimum `annual_base` is 28; `fte_percentage` is 1 for full time. For a first-year employee the result is an accrual estimate.

Results come back as JSON (also as `structuredContent`). An invalid argument returns a tool error that says what to fix.

## A2A

The same four tools are an [A2A](https://a2a-protocol.org) 1.0 agent: the Agent Card is `https://panembrivdienu.lv/.well-known/agent-card.json`, and the JSON-RPC endpoint is `POST https://panembrivdienu.lv/a2a`. Every request needs the header `A2A-Version: 1.0` (or the query `?A2A-Version=1.0`).

`SendMessage` takes one data part, `{"skill": "<tool name>", "arguments": {...}}`, with the tool's arguments as above, and answers with one agent message holding one JSON data part. The agent keeps no task state and does not stream. An invalid argument returns JSON-RPC error `-32602` that says what to fix.

```bash
curl -s https://panembrivdienu.lv/a2a -H 'Content-Type: application/json' -H 'A2A-Version: 1.0' \
  -d '{"jsonrpc":"2.0","id":1,"method":"SendMessage","params":{"message":{"messageId":"m1","role":"ROLE_USER","parts":[{"data":{"skill":"latvia_holidays","arguments":{"year":2026}}}]}}}'
```

## JSON API

- `GET https://panembrivdienu.lv/api/v1/calendar/{year}/holidays`
- `GET https://panembrivdienu.lv/api/v1/calendar/{year}/statistics`
- `POST https://panembrivdienu.lv/api/v1/optimize` with `{"year":2027,"pto_days":10}`
- `POST https://panembrivdienu.lv/api/v1/entitlement` with `{"employment_start_date":"2026-01-01","year":2027,"fte_percentage":1,"annual_base":28}`
- [OpenAPI description](https://panembrivdienu.lv/api/v1/openapi.json) · [API documentation](https://panembrivdienu.lv/api-docs)

## Limits and access

Anonymous clients get 10 requests per second with a burst of 20, per IP address. An API key raises that to 100 per second; send it as `Authorization: Bearer pbd_...` to `/api/v1/`, `/mcp` or `/a2a`. See [auth.md](https://panembrivdienu.lv/auth.md).

## Sources

- [Law on Holidays, Commemorative Days and Celebrations](https://likumi.lv/ta/id/72608-par-svetku-atceres-un-atzimejamam-dienam)
- [Labour Law](https://likumi.lv/ta/id/26019-darba-likums)
- [Privacy policy](https://panembrivdienu.lv/privacy-policy)
