feat: Add LLM-friendly datetime formats for all time-based parameters#50
Open
oskar-korczak wants to merge 8 commits intowinor30:mainfrom
Open
feat: Add LLM-friendly datetime formats for all time-based parameters#50oskar-korczak wants to merge 8 commits intowinor30:mainfrom
oskar-korczak wants to merge 8 commits intowinor30:mainfrom
Conversation
- Add datetime parser utility that accepts multiple formats: - Epoch seconds (number) for backward compatibility - Relative time: now, now-1h, now-30m, now-7d, now-2w - ISO 8601: 2025-11-28T12:00:00Z, 2025-11-28 - Shortcuts: yesterday, today, last week, last month - Update all schema files to accept number | string union types - Update all tool implementations to use the datetime parser - Add comprehensive tests for the datetime parser - Update README with documentation for new datetime formats This makes it much easier for LLMs to specify time ranges without needing to calculate epoch timestamps manually. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This ensures the TypeScript is compiled when installing via npx github:... 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add chrono-node for natural language date parsing - Support shorthand offsets: -1d, 2h, +1w - Support abbreviated formats: 1d ago, 2h ago, in 1d - Support "minus/plus" expressions: minus 1 day, plus 2 hours - Maintain backward compatibility with now-1h format - Expand unit aliases: s/sec/secs, m/min/mins, h/hr/hrs, etc. - Update tests to cover new formats Now supports all common LLM-generated datetime expressions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Rename package to @oskar-korczak-complexio/mcp-server-datadog - Update repository URL to fork - Bump version to 1.8.0 (LLM-friendly datetime formats) - Update publish workflow for OIDC (no NPM_TOKEN needed) - Add test step to CI before publishing - Switch from pnpm publish to npm publish (OIDC support) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for human-readable datetime formats across all time-based parameters (
from,to,start,end,until), making it much easier for LLMs to specify time ranges without calculating epoch timestamps.Supported Formats
1732713600nownownow-1h,now-30m,now-7d,now-2w2025-11-28T12:00:00Z,2025-11-28yesterday,today,last week,last monthExample Usage
Changes
src/utils/datetime-parser.ts- Centralized datetime parsing utilitynumber | stringunion types for time parametersMotivation
LLMs struggle with epoch timestamp calculations. This change allows natural language-like time specifications while maintaining full backward compatibility with numeric timestamps.
Test plan
🤖 Generated with Claude Code