đź“„ Web Search / Scrape Troubleshooting
Common Issues When Implementing Web Search Tools in Agents
If your agent’s web search keeps failing or looping, start here.
The fastest fix is often the simplest: try a different underlying model before deep-diving into debugging.
Symptom: endless tool loop or failed call
Typical pattern: the agent knows it must search but constructs an invalid call (e.g., missing a required “query” parameter). You’ll see repeated attempts without progress.
First step: switch models
Before anything else, change the model in agent settings and rerun. Different models vary in how well they follow tool schemas.
Why it works: Some models understand tool signatures more reliably and format inputs correctly.
What to try: Switch between model families/versions (e.g., GPT-4 variants, Claude variants).
Why model selection matters
Even closely related models have different strengths. A model might be brilliant at writing, but less consistent at structured tool use. If intent is correct but formatting isn’t, a model swap can resolve it immediately.
Quick case study
Swapping from a newer “advanced” model (Claude Opus 4.1) to an older alternative (Claude Sonnet 3.7) resolved a missing-query loop immediately. The replacement model correctly populated the search parameters and completed the task.
If switching doesn’t fix it
Validate tool schema: Confirm required parameters (name, types, defaults)
Add explicit instruction scaffolding: “Always include a non-empty query string”
Provide examples: Show a complete, valid tool call payload
Reduce ambiguity: Remove unused tools; simplify instructions
Add guardrails: Stop after N failed attempts and surface the error
Summary
Model swaps are your fastest first move for tool failures. If the issue persists, tighten instructions, validate schemas, and reduce complexity until the agent produces a valid call.
If you can get an agent to use the tool successfully but it’s not the model you want for your agent - ask this agent to output the expected tool schema, and then write this explicitly into the instructions and try the model that wasn’t doing it before - it should help!