[MCP browser-automation] Improve timeout error messages with diagnostics
Resolved 💬 1 comment Opened Jan 10, 2026 by trungnguyenvn Closed Jan 10, 2026
Problem
When browser_wait_for_selector times out, the error message is too generic to debug:
MCP error -32000: Tool failed: Request timeout
This doesn't indicate:
- Whether the element was ever found
- The current page URL
- If element exists but wrong state (hidden vs visible)
- The selector that failed
Suggested Improvement
Include diagnostic information in timeout errors:
MCP error -32000: browser_wait_for_selector timed out after 30000ms
- Selector: .source-item:not(.loading)
- Page URL: https://notebooklm.google.com/...
- Reason: Element not found on page
- Expected state: visible
Helpful Diagnostics
- Selector - What we were looking for
- Page URL - Where we were looking
- Failure reason - Not found / found but wrong state / MCP connection issue
- Element state - If partially matched (e.g., "element exists but hidden")
- Elapsed time - How long we waited
Impact
Better error messages would significantly improve debugging efficiency for browser automation tasks.
Related
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗