browser_wait_for_selector times out with MCP error -32000

Resolved 💬 1 comment Opened Jan 10, 2026 by trungnguyenvn Closed Jan 10, 2026

Bug Description

The browser_wait_for_selector MCP tool returns a generic timeout error that lacks useful debugging information.

Steps to Reproduce

  1. Use the browser_wait_for_selector tool with these parameters:
  • selector: .source-item:not(.loading)
  • timeout: 30000
  • state: visible
  1. Wait for the operation to complete

Error Message

MCP error -32000: Tool failed: Request timeout

Expected Behavior

The tool should either:

  1. Successfully wait for the selector and return when found
  2. Return a proper timeout error with useful debugging information if the element is not found within the timeout period, such as:
  • Whether the element was never found
  • Whether the MCP connection itself timed out
  • Whether there was a browser/page issue
  • Current page URL and state

Actual Behavior

Returns generic MCP error -32000 with "Tool failed: Request timeout" which doesn't indicate the root cause of the failure.

Context

This occurred while trying to wait for a source item element to become visible in NotebookLM after uploading a file.

Impact

  • Difficult to debug whether the issue is with the selector, the page state, or the MCP connection
  • No way to distinguish between different failure modes
  • Makes automated workflows harder to troubleshoot

Suggested Improvements

  1. Include the selector that was being waited for in the error message
  2. Include the current page URL
  3. Distinguish between "element not found" vs "MCP connection timeout"
  4. Optionally include a snapshot of available elements matching partial selector

View original on GitHub ↗

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