{"service":"date-math","name":"Date Math","version":"1.2.0","description":"Deterministic date and time math for AI agents. POST a JSON body; every response is a JSON object.","spec":"/openapi.json","mcp":"https://date-math.datemath.workers.dev/mcp (Streamable HTTP; tools are paid per call via x402 MCP)","endpoints":{"POST /v1/diff":{"mcp_tool":"date_diff","description":"Difference between two dates or datetimes: calendar (Y/M/D), total days/weeks/hours, and business days (weekdays in [from, to) minus holidays; pass country to exclude its public holidays).","example":{"from":"2026-01-31","to":"2026-03-15","country":"US"}},"POST /v1/add":{"mcp_tool":"date_add","description":"Add or subtract years/months/weeks/days/business days/hours/minutes/seconds. Month-end clamping; business days skip weekends, given holidays, and the public holidays of an optional country.","example":{"date":"2026-12-22","business_days":5,"country":"PH"}},"POST /v1/convert":{"mcp_tool":"timezone_convert","description":"Convert an instant or local wall-clock time between IANA time zones (DST-aware).","example":{"datetime":"2026-11-07T14:30:00","from_timezone":"Asia/Manila","to_timezone":"America/New_York"}},"POST /v1/info":{"mcp_tool":"date_info","description":"Calendar facts for a date: weekday, ISO week, quarter, day of year, leap year, weekend.","example":{"date":"2026-11-07"}},"POST /v1/holidays":{"mcp_tool":"public_holidays","description":"Public holidays for a country and year: 207 countries, 2000–2050. Lunar or government-proclaimed dates are rule-based estimates.","example":{"country":"PH","year":2026}},"POST /v1/overlap":{"mcp_tool":"working_hours_overlap","description":"Find when working hours overlap across time zones (meeting windows). Per-participant hours optional; skips weekends by default; up to 14 days.","example":{"timezones":["Asia/Manila","Europe/London"],"date":"2026-11-10","work_start":"09:00","work_end":"18:00"}},"POST /v1/cron":{"mcp_tool":"cron_schedule","description":"Explain a cron expression in plain English and list its next run times in any time zone.","example":{"expression":"0 9 * * 1-5","timezone":"Asia/Manila","count":3}},"POST /v1/parse":{"mcp_tool":"parse_date_text","description":"Resolve natural-language dates like \"next Friday at 3pm\", \"in 2 weeks\" or \"Dec 25 to Jan 2\" to exact datetimes, relative to a reference time and time zone.","example":{"text":"next friday at 3pm","timezone":"Asia/Manila","reference":"2026-11-07T14:00:00+08:00"}},"POST /v1/city":{"mcp_tool":"city_time","description":"Find the IANA time zone and current local time for up to 10 cities by name (\"Cebu\", \"São Paulo\", \"Springfield\" + country). 7,000+ cities.","example":{"cities":["Cebu","London","New York"]}},"POST /v1/recurrence":{"mcp_tool":"recurring_dates","description":"Expand an iCalendar RRULE (\"every 2nd Tuesday\", \"Mon/Wed until June\") into concrete dates and times in a time zone, DST-aware, with optional excluded dates.","example":{"rrule":"FREQ=MONTHLY;BYDAY=2TU","start":"2026-01-01T10:00","timezone":"Asia/Manila","count":3}},"POST /v1/business_hours":{"mcp_tool":"business_hours_deadline","description":"SLA math in working hours: the deadline N business hours after a start time, or business time elapsed between two times. Custom hours and workdays, holidays, country public holidays, DST-aware.","example":{"start":"2026-11-06T16:00","hours":2,"timezone":"Asia/Manila","work_start":"09:00","work_end":"17:00","country":"PH"}}},"free":["GET /v1/version","GET /v1/health","GET /openapi.json","GET /llms.txt","GET /.well-known/x402"],"errors":"{\"error\":{\"code\",\"message\"}} with HTTP 400/404/413","payment":"Pay per call with x402 v2 (USDC on Base, $0.001). POST without payment returns 402 with terms in the PAYMENT-REQUIRED header; retry with PAYMENT-SIGNATURE."}