DEV Community

Solvo Dev Notes
Solvo Dev Notes

Posted on

My AI agent can't click "Sign up for an API key" — so I built a business-day endpoint with no signup

I've been running an autonomous coding agent for a while now. It writes code, opens PRs, and occasionally needs to compute things like "what's the SLA deadline if a ticket lands today and we promise resolution in 5 business days?"

Two problems showed up immediately, and they're the reason this post exists.

Problem 1: LLMs are genuinely bad at date arithmetic

This isn't a hot take, it's measurable. A 2025 arXiv study ("Lost in Time: Clock and Calendar Understanding Challenges in Multimodal LLMs") found that models do okay on popular holidays — likely because the answer is memorized — but accuracy "diminishes substantially for lesser-known or arithmetically demanding queries (e.g., 153rd day), indicating that performance does not transfer well to offset-based reasoning."

That matches what I see in practice. Ask a model "add 5 business days to 2026-05-15, skipping weekends" and you'll get a confident, plausible, and frequently off-by-one answer. Business-day math is exactly the kind of deterministic, rule-based calculation where "close enough" is just wrong: weekends, observed-holiday shifting, and counting conventions all compound. The well-known fix is to stop asking the model to be a calculator and hand the calculation to a deterministic tool.

Problem 2: every deterministic tool wants me to sign up first

So I went looking for a hosted business-day API. They exist and several are good. But here's the wall my agent hit:

  • API Ninjas Working Days — requires an account and an X-Api-Key header on every request.
  • workingdays.org — requires an account; runs on a monthly quota with profiles.
  • timeanddate.com Business Days Calculator — no permanent free tier; access starts at $299, or a 3-month trial.

To be fair: most of these do offer a usable free tier. The blocker isn't the price. The blocker is that every one of them requires creating an account and provisioning a key before the first request will succeed. A human does that in two minutes. An autonomous agent cannot — there's no inbox to confirm, no dashboard to click, no human in the loop. The signup step is where the automation dies.

So I shipped the boring version: OpenWorkdays

OpenWorkdays is a zero-signup, zero-key business-day date API. One anonymous GET, JSON back. MIT, zero-dependency, source on GitHub.

Add business days:

curl "https://openworkdays.vercel.app/api/businessdays?start=2026-05-15&days=5"
Enter fullscreen mode Exit fullscreen mode

Count business days between two dates:

curl "https://openworkdays.vercel.app/api/businessdays?start=2026-05-15&end=2026-05-29"
Enter fullscreen mode Exit fullscreen mode

Is this date a business day?

curl "https://openworkdays.vercel.app/api/businessdays?date=2026-05-16"
Enter fullscreen mode Exit fullscreen mode

One endpoint, three modes (add, diff, is). You can configure the weekend (weekend=sat,sun) and pass your own holiday list (holidays=2026-05-25,2026-07-03).

The honest scope (read this before you adopt it)

I'd rather you not be surprised in production, so plainly:

  • Date-only, pure UTC arithmetic. No time-of-day, no DST, no timezones. If you need "5 business days from 3pm Berlin time," this is the wrong tool.
  • No built-in country holiday database. There is no magic country=US. You supply the holidays you care about via holidays=YYYY-MM-DD,.... This is a deliberate trade: it keeps the service stateless and free of a holiday-data dependency, but it means you own the holiday calendar.
  • Best-effort, per-instance rate limit. It's free and unauthenticated; don't build a billing system on it without a fallback.

For the common agent/backend case — "skip weekends and these N holidays I already know about" — that scope is exactly enough, and the determinism is the whole point.

For LLM clients: there's an MCP server too

If your agent speaks Model Context Protocol, you can skip HTTP plumbing entirely. There's a remote MCP server (Streamable HTTP, stateless JSON-RPC 2.0, one businessdays tool), also zero-signup:

{
  "mcpServers": {
    "openworkdays": {
      "url": "https://openworkdays.vercel.app/api/mcp"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Drop that into Claude Desktop or Cursor and the model can call business-day math instead of guessing at it.

Why this is the right shape

The general principle: if a task is deterministic and the model is unreliable at it, delegate to a deterministic tool. The under-discussed corollary is that the tool also has to be reachable by the agent. An API behind a signup wall is, from an autonomous agent's perspective, not a tool — it's a tool with a human dependency bolted on.

OpenWorkdays is intentionally small and intentionally honest about its limits. If it saves you one off-by-one SLA bug, it did its job. Feedback and issues welcome on the repo.

Top comments (0)