ChronoGuard
Deterministic date, time, timezone, holiday, and business-day arithmetic for AI agents via MCP.
LLMs are good at language. They should not have to guess whether a deadline lands on a holiday, whether five business days crosses a weekend, or what a timestamp means across a daylight-saving transition. ChronoGuard moves that work into a small deterministic tool with a stable contract.
Status
v0.1.1 — public validation prototype
Validated in Replit on September 11, 2026 with:
- 28 automated tests passing
- FastMCP 4.0.3
- MCP 2.2.0
- Real
holidayspackage integration - Successful real stdio MCP client discovery of
chronoguard_resolve_time - Successful end-to-end MCP tool invocation through the stdio server
- Successful FastMCP inspector discovery
ChronoGuard is ready for developer testing, but it is not yet positioned as production-grade global business-calendar infrastructure.
What ChronoGuard solves
ChronoGuard gives an agent a deterministic answer for temporal questions that are easy for an LLM to get subtly wrong.
Example workflows:
- SLA deadlines — “What is 4 US business days after this support ticket opened?”
- Billing and finance cutoffs — “What is the previous business day before month-end?”
- Rolling data windows — “Give me the exact timestamps for the last 30 days.”
- Timezone-safe scheduling — “Convert this timestamp to America/Chicago and preserve the correct date.”
- Holiday-aware automation — “What date is 5 business days after Friday, September 11, 2026?”
Supported operations
The MCP tool is named:
chronoguard_resolve_time
Supported operations:
current_timeadd_durationsubtract_durationbusiness_day_offsetcalculate_span
Supported units:
minuteshoursdaysweeksbusiness_days
Other inputs:
- IANA timezone such as
America/ChicagoorUTC - ISO-8601 reference timestamp
- Country code such as
US - Optional holiday-calendar subdivision such as a state or region when supported by the
holidayspackage
Temporal semantics
ChronoGuard deliberately distinguishes different meanings of “add time”:
- Minutes / hours: elapsed-time arithmetic. Calculation happens through UTC and converts back to the requested timezone.
- Days / weeks: local calendar arithmetic, preserving wall-clock time across DST changes.
- Business days: local calendar arithmetic that skips weekends and supported official holidays.
- Naive local timestamps: accepted only when they map to one unambiguous real instant. Nonexistent spring-forward times and ambiguous fall-back times are rejected unless an explicit UTC offset is supplied.
Important v0.1 limitation
ChronoGuard currently assumes Saturday and Sunday are weekends for business-day calculations.
The holidays dependency supports many countries and subdivisions, but that does not mean v0.1 correctly models every country's weekend convention, banking calendar, exchange calendar, or company-specific business calendar.
Do not describe v0.1 as universally correct for global business calendars.
Install
Requires Python 3.11+.
python -m pip install -r requirements.txt
Run the tests
From the project root:
python -m pytest -v
Expected result for this release:
28 passed
Inspect the MCP server
fastmcp inspect server.py
A successful inspection should show one registered tool.
Run locally over stdio
python server.py
ChronoGuard currently uses MCP stdio transport for local clients.
Example MCP client call
import asyncio
from fastmcp import Client
from server import mcp
async def main():
async with Client(mcp) as client:
result = await client.call_tool(
"chronoguard_resolve_time",
{
"operation": "business_day_offset",
"timezone": "America/Chicago",
"reference_timestamp": "2026-09-11T10:00:00",
"value": 5,
"country_code": "US",
},
)
print(result.data)
asyncio.run(main())
Expected resolved date:
2026-09-18
Example MCP configuration
For an MCP client that launches local stdio servers, use a configuration shaped like this and replace the path with the absolute location of server.py on your machine:
{
"mcpServers": {
"chronoguard": {
"command": "python",
"args": ["/absolute/path/to/server.py"]
}
}
}
Depending on the client and Python environment, you may need to use the absolute path to the Python executable for the environment where ChronoGuard's dependencies are installed.
Example response
A successful business-day call returns structured data such as:
{
"resolved_datetime_iso": "2026-09-18T10:00:00-05:00",
"timezone": "America/Chicago",
"day_of_week": "Friday",
"is_business_day": true,
"is_holiday": false,
"holiday_name": null,
"date_range": null
}
Error behavior
ChronoGuard fails explicitly rather than silently guessing when it encounters inputs such as:
- Invalid IANA timezone names
- Invalid ISO timestamps
- Unsupported holiday calendars
- Nonexistent DST-local times
- Ambiguous DST-local times without an explicit offset
That behavior is intentional: a deterministic agent tool should prefer a clear error to a plausible but wrong date.
What is not in v0.1
Not yet supported:
- Non-Saturday/Sunday weekend conventions
- NYSE or other exchange calendars
- Federal Reserve settlement calendars
- Custom company holiday calendars
- Remote HTTP transport
- Authentication or rate limiting
- Hosted commercial API
- Billing or usage metering
Those should be added only after developer demand justifies them.
Why this exists
The experiment behind ChronoGuard is simple:
When an AI workflow has a narrow deterministic failure mode, move that task out of LLM reasoning and into a small tool with a strict contract.
ChronoGuard is the first test of that idea.
Feedback wanted
This release is intentionally small. Useful feedback includes:
- Where your agent currently gets date/time logic wrong
- Which calendar rules you actually need
- Whether local stdio is enough or remote HTTP matters
- Which operations you expected but did not find
- Whether you would adopt a shared temporal utility instead of maintaining date logic inside each agent
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chronoguard-0.1.1.tar.gz.
File metadata
- Download URL: chronoguard-0.1.1.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de5e08371d88cfc1a8627b522f293ed8798795a6318580642ffd829c94d9aefa
|
|
| MD5 |
a13ee27dd66a94b2aac4ae3f0eb9f1e2
|
|
| BLAKE2b-256 |
6e851ce2e90c891387034b0f5d6ce5006a4a521635fb53e6ec6157f90373477d
|
File details
Details for the file chronoguard-0.1.1-py3-none-any.whl.
File metadata
- Download URL: chronoguard-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a85538842d47cbcbc1c6a4594c7799bb342bd7cab796706adf6672a3029e1e4
|
|
| MD5 |
e8b0afbdb868cc8409c62e52c6e888a4
|
|
| BLAKE2b-256 |
6fa4c142bb6d67b7084a92b753c953e1b605bfbdcd3e3a688106eba34bf6af37
|