browser_run_code
Execute a JavaScript async function in the browser that receives the page object, enabling direct automation of any browser task.
Instructions
Run a Playwright code snippet. The function receives page as its argument. Example: async (page) => { await page.goto('https://example.com'); return await page.title(); }
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "browser_run_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | A JavaScript async function string that receives `page` as argument |