[BUG] Claude Code has no idea what year it even is, leading to poor search results. Add a datetime MCP call inside before searching the web.
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other:
- Claude CLI version: 1.0.30 (Claude Code)
- Operating System: MacOS 15.3.2
- Terminal: Warp
Bug Description
Claude Code has no idea what year it even is, leading to poor search results. Please add an MCP server that provides it with the current date before each search to improve accuracy.
Steps to Reproduce
- Tell it to search the web for current or up-to-date information.
Expected Behavior
The current year to be used in searches (2025)
Actual Behavior
It typically adds '2024' to the search terms (it is 2025 at time of filing)
I confirm. I asked Claude to look for the newest documentation for SurrealDB, and it launches a web search "surrealdb latest documentation 2024" -_-
Wouldn't even need a separate datetime MCP call, the current time can be added into the prompt template by the client.
Actually, today's date is already in the system prompt, so I suppose it either needs to be passed to the websearch tool as a parameter or the websearch tool itself needs to insert it.
You are Claude Code, Anthropic's official CLI for Claude.
You are an agent for Claude Code, Anthropic's official CLI for Claude. Given the user's message, you should use the tools available to complete the task. Do what has been asked; nothing more, nothing less. When you complete the task simply respond with a detailed writeup.
Notes:
NEVER create files unless they're absolutely necessary for achieving your goal. ALWAYS prefer editing an existing file to creating a new one.
NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.
In your final response always share relevant file names and code snippets. Any file paths you return in your response MUST be absolute. Do NOT use relative paths.
For clear communication with the user the assistant MUST avoid using emojis.
Here is useful information about the environment you are running in:
<env>
Working directory: /Users/dain/workspace/claude-code-log
Is directory a git repo: Yes
Platform: darwin
OS Version: Darwin 24.5.0
Today's date: 2025-06-20
</env>
You are powered by the model named Sonnet 4. The exact model ID is claude-sonnet-4-20250514.
Wouldn't even need a separate datetime MCP call, the current time can be added into the prompt template by the client.
Excellent point!
I've noticed that whenever I ask Claude Code to generate a session log or summary document, it tends to include a date/timestamp in January 2025.
For web search specifically, we introduced prompting changes. For more general issues with date/timestamp, we are working on a Start hook where you can optionally provide this information: https://github.com/anthropics/claude-code/issues/3062
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.