A newer version of the Gradio SDK is available: 6.13.0
Playwright MCP Tools Reference
This document describes all available Playwright MCP browser automation tools.
Browser Navigation Tools
browser_navigate
Navigate to a URL.
- Arguments:
url(string): The URL to navigate to
browser_navigate_back
Go back in browser history.
- Arguments: None
Browser Interaction Tools
browser_click
Click on an element.
- Arguments:
selector(string): CSS selector for the elementbutton(string, optional): "left", "right", or "middle" (default: "left")clickCount(number, optional): Number of clicks (default: 1)
browser_hover
Hover over an element.
- Arguments:
selector(string): CSS selector for the element
browser_drag
Drag an element.
- Arguments:
selector(string): CSS selector for the element to dragtarget(string): CSS selector for the drop target
browser_type
Type text into an input field.
- Arguments:
selector(string): CSS selector for the input elementtext(string): Text to typedelay(number, optional): Delay between keystrokes in milliseconds
browser_press_key
Press a keyboard key.
- Arguments:
key(string): Key to press (e.g., "Enter", "Escape", "Tab")
browser_fill_form
Fill a form with data.
- Arguments:
selector(string): CSS selector for the formdata(object): Key-value pairs of form field names and values
browser_select_option
Select an option from a dropdown.
- Arguments:
selector(string): CSS selector for the select elementvalue(string): Value of the option to select
Browser Information Tools
browser_take_screenshot
Take a screenshot of the current page.
- Arguments: None (or optional viewport settings)
browser_snapshot
Get the HTML snapshot of the current page.
- Arguments: None
browser_console_messages
Get console messages from the browser.
- Arguments: None
browser_network_requests
Get network request information.
- Arguments: None
browser_tabs
List all open browser tabs.
- Arguments: None
Browser Control Tools
browser_wait_for
Wait for an element or condition.
- Arguments:
selector(string): CSS selector to wait forstate(string): "visible", "hidden", "attached", or "detached"timeout(number, optional): Timeout in milliseconds (default: 30000)
browser_resize
Resize the browser window.
- Arguments:
width(number): New width in pixelsheight(number): New height in pixels
browser_close
Close the browser.
- Arguments: None
Advanced Tools
browser_evaluate
Execute JavaScript in the browser context.
- Arguments:
script(string): JavaScript code to execute
browser_run_code
Run code in the browser context (similar to evaluate).
- Arguments:
code(string): Code to run
browser_handle_dialog
Handle browser dialogs (alert, confirm, prompt).
- Arguments:
action(string): "accept" or "dismiss"text(string, optional): Text to enter for prompt dialogs
browser_file_upload
Upload a file to an input element.
- Arguments:
selector(string): CSS selector for the file inputfilePath(string): Path to the file to upload
browser_install
Install browser dependencies (usually run once).
- Arguments: None
Usage Tips
Always wait for elements: Use
browser_wait_forbefore interacting with elements that might not be loaded yet.Use selectors carefully: CSS selectors should be specific enough to target the right element.
Handle async operations: Many browser operations are asynchronous - wait for them to complete.
Take screenshots for debugging: Use
browser_take_screenshotto see what the browser sees.Check console messages: Use
browser_console_messagesto debug JavaScript errors.
Example Workflow
browser_navigate- Navigate to a pagebrowser_wait_for- Wait for page to loadbrowser_snapshot- Get page content (optional)browser_click/browser_type- Interact with elementsbrowser_take_screenshot- Capture statebrowser_close- Clean up