From f7cad9118947484914c58935785b3629b493d649 Mon Sep 17 00:00:00 2001 From: Matthieu Date: Sun, 26 Jul 2026 21:24:43 +0200 Subject: [PATCH] fix(tools): stop web_search from swallowing requests that name a URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Asked to open a specific page and summarise it, the model called web_search with the URL as the query — and added a freshness filter of its own, so the search returned nothing useful. It never fetched the page it had just been handed. The two descriptions are asymmetric. web_fetch already says "Use when you already have a concrete URL/domain. NOT for open-ended searches (use web_search)", so the model has a reason not to reach for it when searching. web_search says nothing about URLs, so nothing argues against using it for one. The gap shows up with smaller models, which lean on the descriptions rather than on judgement. Adds the reciprocal guidance. Measured with the real toolset on a local model: the same request went from web_search to web_fetch. Worth recording that tool count matters as much as wording here. The same prompt resolved correctly with 3 tools in a clean context, chose web_search with the 20 the agent loop offers, and chose web_fetch again once the toolset was trimmed and this description fixed. The wording is necessary but not sufficient — it is the cheap half of the fix. Co-Authored-By: Claude Opus 5 --- src/tool_schemas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tool_schemas.py b/src/tool_schemas.py index 7585f3e9d..865c3eb91 100644 --- a/src/tool_schemas.py +++ b/src/tool_schemas.py @@ -64,7 +64,7 @@ FUNCTION_TOOL_SCHEMAS = [ "type": "function", "function": { "name": "web_search", - "description": "Quick single web lookup for a fact or current event mid-task. NOT for 'research X' / 'do research on X' — those are deep-research jobs; use trigger_research instead.", + "description": "Quick single web lookup for a fact or current event mid-task, when you do NOT already know which page to read. NOT when the user hands you a URL — fetch that page with web_fetch instead of searching for it. NOT for 'research X' / 'do research on X' — those are deep-research jobs; use trigger_research instead.", "parameters": { "type": "object", "properties": {