Evaluate JS in the page
browser_evaluateEvaluate a JavaScript expression in a Firefox page and return its JSON value, awaiting promises. Use it to inspect or modify page state, treating changes as writes.
Instructions
Run an expression in the page and return its value (JSON). Promises are awaited. It can change the page, so treat it as a write.
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": {
"expression": "<expression>"
},
"name": "browser_evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | Tab context id (default: the active tab) | |
| expression | Yes | JavaScript expression to evaluate |