File tree Expand file tree Collapse file tree
packages/opencode/src/tool Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ interface McpSearchResponse {
4040export const WebSearchTool = Tool . define ( "websearch" , async ( ) => {
4141 return {
4242 get description ( ) {
43- return DESCRIPTION . replace ( "{{date }}" , new Date ( ) . toISOString ( ) . slice ( 0 , 10 ) )
43+ return DESCRIPTION . replace ( "{{year }}" , new Date ( ) . getFullYear ( ) . toString ( ) )
4444 } ,
4545 parameters : z . object ( {
4646 query : z . string ( ) . describe ( "Websearch query" ) ,
Original file line number Diff line number Diff line change @@ -10,5 +10,5 @@ Usage notes:
1010 - Configurable context length for optimal LLM integration
1111 - Domain filtering and advanced search options available
1212
13- Today's date is {{date }}. You MUST use this year when searching for recent information or current events
14- - Example: If today is 2025-07-15 and the user asks for "latest AI news", search for "AI news 2025 ", NOT "AI news 2024 "
13+ The current year is {{year }}. You MUST use this year when searching for recent information or current events
14+ - Example: If the current year is 2026 and the user asks for "latest AI news", search for "AI news 2026 ", NOT "AI news 2025 "
You can’t perform that action at this time.
0 commit comments