evaluate
Execute JavaScript in the browser context and return the result to extract data, check page state, or perform actions other browser tools do not cover.
Instructions
[Agent Browser] Execute JavaScript in the browser context and return the result. NOTE: This runs raw JS, NOT Playwright selectors. Use document.querySelector(), not text=. Useful for extracting data, checking state, or performing actions not covered by other tools.
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": {
"script": "<script>"
},
"name": "evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| hints | No | ||
| message | No | ||
| success | No | ||
| suggestions | No |