modelcontextprotocol / modelcontextprotocol/servers
Get past time from the Time MCP server
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 90.5k
- Forks
- 11.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 5
Description
Is your feature request related to a problem? Please describe.
As part of my work, I need a way to get past time.
For example, one of my customers might ask something like "Which requests were sent in the last 5 hours?"
I need to first fetch the time from 5 hours ago, and then call the tool that can fetch those requests based on a start time and end time.
Describe the solution you'd like
I would like to have a tool called get_time_ago with the following fields:
- days_ago: int of how many days ago the time should be
- hours_ago: int of how many hours ago the time should be
- minutes_ago: int of how many minutes ago the time should be
- seconds_ago: int of how many second ago the time should be
- milliseconds_ago: int of how many milliseconds ago the time should
So for example, if I ask the LLM "Give me all the requests from two and a half hours ago", it will call get_time_ago(hours_ago=2, minutes_ago=30)
Describe alternatives you've considered
One possible alternative is that the LLM will call the get_current_time tool and deduce the past time on its own. Meaning, that this capability will be handled in the LLM side instead of the MCP side.
From my experience, LLMs have hard time to calculate time on their own, so if I run the "get_current_time" tool, the LLM might not be able to deduce the new time from the returned string. Having a dedicated tool for that will probably make our lives easier that way.
Additional context
If I will get an OK from the maintainers, I would gladly implement this!
In the implementation, I would probably use the datetime.timedelta class to handle the time differences.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing get_current_time tool in the Time MCP server and review how its inputs and returned time are represented. Add the requested get_time_ago behavior for days, hours, minutes, seconds, and milliseconds, then verify that a request such as two hours and thirty minutes ago returns the corresponding past time.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100