evaluate
Run JavaScript in the shared browser page to extract data or inspect state, returning a JSON-serializable result; accepts a bare expression or statements with return.
Instructions
Run JavaScript in the page and return the JSON-serializable result. Both a bare expression ("document.title") and statements using "return x" are accepted. Powerful; prefer snapshot/query when possible.
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 |
|---|---|---|---|
| tabId | No | ||
| script | Yes | JS expression or statements; use "return x" for a value |