claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[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.

Open sooth opened this issue 6 months ago • 5 comments

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

  1. 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)

sooth avatar Jun 20 '25 16:06 sooth

I confirm. I asked Claude to look for the newest documentation for SurrealDB, and it launches a web search "surrealdb latest documentation 2024" -_-

SigismondPhilippe avatar Jun 20 '25 21:06 SigismondPhilippe

Wouldn't even need a separate datetime MCP call, the current time can be added into the prompt template by the client.

daaain avatar Jun 20 '25 22:06 daaain

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.

daaain avatar Jun 20 '25 23:06 daaain

Wouldn't even need a separate datetime MCP call, the current time can be added into the prompt template by the client.

Excellent point!

sooth avatar Jun 21 '25 00:06 sooth

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.

rajivsinclair avatar Jun 23 '25 05:06 rajivsinclair

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

dicksontsai avatar Jul 07 '25 22:07 dicksontsai

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.

github-actions[bot] avatar Aug 14 '25 14:08 github-actions[bot]