[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

  1. Selector - What we were looking for
  2. Page URL - Where we were looking
  3. Failure reason - Not found / found but wrong state / MCP connection issue
  4. Element state - If partially matched (e.g., "element exists but hidden")
  5. Elapsed time - How long we waited

Impact

Better error messages would significantly improve debugging efficiency for browser automation tasks.

Related

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗