Skip to content

CLI error messages tell users to call MCP tools (browser_click, browser_network_requests, ...) that don't exist in the CLI #515

Closed
microsoft/playwright
#43932

Description

Some messages are CLI-aware. The modal state line says can be handled by dialog-accept or dialog-dismiss, and network hints say Run `response-body 2` . Several other errors still use MCP tool names, which a CLI user or agent can't run.

Steps to reproduce

playwright-cli open http://127.0.0.1:8765/app.html   # page with <button onclick="alert('hi')">
playwright-cli click e2            # opens the alert
playwright-cli click e3
playwright-cli snapshot
playwright-cli dialog-accept
playwright-cli dialog-accept       # no dialog now
playwright-cli request 99
playwright-cli request 0
playwright-cli check e17           # e17 is a <button>

Actual

Error: Tool "browser_click" does not handle the modal state.
Error: Tool "browser_snapshot" does not handle the modal state.
Error: The tool "browser_handle_dialog" can only be used when there is related modal state present.
Request #99 not found. Use browser_network_requests to see available indexes.
Invalid arguments for tool "browser_network_request":
✖ Too small: expected number to be >=1
Error: Error: Not a checkbox or radio button

Expected

In skill mode (config.skillMode), name the CLI command and how to resolve the state, the way renderModalStates and partHint already do. For example: click is blocked by an open "alert" dialog; run dialog-accept or dialog-dismiss first, Request #99 not found. Run requests to see available numbers., and 'index' argument: expected number >= 1. Also drop the doubled Error: Error: prefix.

Environment

  • @playwright/cli 0.1.23 (main @ f50f579), playwright-core 1.65.0-alpha-2026-10-30
  • Node 22.23.4, Linux x64, Chrome for Testing 153

Activity

  1. github-actions commented on Nov 5, 2026

    @github-actions
  2. microsoft-playwright-automation commented on Nov 5, 2026

    @microsoft-playwright-automation
    Contributor

    Hi, I'm the Playwright bot and I reproduced this on Linux with Chromium, Firefox and WebKit at upstream main edeb0bd05176ff187c372c1e38e5d89a232bd5b3 (1.66.0-next).

    The CLI errors use MCP-only names. The daemon does not pass the CLI command name to the shared backend, and several recovery hints do not check skill mode. The proposed fix uses CLI command names and recovery commands, and avoids adding a second Error: prefix without changing MCP output.

    All three regression cases fail without the fix and pass with it on all three browsers. The neighboring CLI and MCP suites pass: 428 passed, 4 skipped.

    Draft PR: microsoft/playwright#43932

    Triaged on Linux by the Playwright bot - agent run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions