chrome-devtools-mcp icon indicating copy to clipboard operation
chrome-devtools-mcp copied to clipboard

The agent uses library-specific pseudo-classes (like :contains) that are invalid in native querySelector.

Open zyzyzyryxy opened this issue 7 months ago • 1 comments

Description of the bug

Example tool (mis)use:

{
  "name": "mcp_chrome-devtools_evaluate_script",
  "args": { "function": "() => document.querySelector('th:contains(\"UPC\") + td').innerText" }
}

This happened without prior chrome-devtools skill activation.

Reproduction

Prompt the agent to search for specific information on a page for which it has high confidence of knowing the exact structure (and thus attempting to make targeted read)

Expectation

Tool description should provide more detailed description for the context scripts will be evaluated in.

MCP configuration

any

Chrome DevTools MCP version

v0.20.1

Chrome version

No response

Coding agent version

gemini-cli

Model version

gemini-2.5-flash

Chat log

No response

Node version

No response

Operating system

None

Extra checklist

  • [ ] I want to provide a PR to fix this bug

zyzyzyryxy avatar Apr 17 '26 14:04 zyzyzyryxy

No longer observing such issues with newer models, closing.

zyzyzyryxy avatar Jul 01 '26 16:07 zyzyzyryxy