Browser Tools

The browser automation system exposes 30+ tools through @playwright/mcp. These tools cover navigation, element interaction, page inspection, input handling, tab management, and advanced operations.

Tool Reference

Each tool below is available to the AI model during browser automation sessions. The model selects which tools to invoke based on the task at hand and the current page state.

ToolDescription
navigateNavigate to a URL. Waits for the page to load before returning.
navigate_backGo back in the browser history. Equivalent to clicking the back button.
wait_forWait for a specific condition (element visible, text appears, network idle).

Interaction Tools

ToolDescription
clickClick on an element identified by selector or accessibility reference.
hoverHover over an element to trigger tooltips or dropdown menus.
dragDrag an element from one position to another.
select_optionSelect an option from a dropdown or select element.

Inspection Tools

ToolDescription
snapshotCapture the page accessibility tree. This is how the AI "sees" page structure.
screenshotTake a visual screenshot of the current viewport.
console_messagesRetrieve console log output from the browser developer tools.
Snapshot vs. Screenshot
The snapshot tool returns a text-based accessibility tree that the model can parse efficiently. screenshot captures a visual image. The model typically uses snapshots for understanding page structure and screenshots for visual verification.

Input Tools

ToolDescription
typeType text into the currently focused element.
press_keyPress a keyboard key or key combination (e.g., Enter, Ctrl+A).
file_uploadUpload a local file to a file input element.

Tab Management

ToolDescription
tabsList all open browser tabs with their URLs and titles. Used for tab switching.

The model can open new tabs by navigating to URLs that trigger new windows, or by using JavaScript evaluation. Each tab is independently addressable and maintains its own navigation history. Parallel tab support means the model can have multiple pages open simultaneously.

Advanced Tools

ToolDescription
evaluateExecute arbitrary JavaScript in the page context. Returns the result.
JavaScript evaluation
The evaluate tool executes arbitrary JavaScript in the browser context. This is powerful but carries risk -- it can read page data, modify the DOM, or make network requests. This tool always requires explicit approval in chat mode.