javascript_tool
Execute JavaScript in a browser tab to debug and inspect page state, returning the expression result or last statement value.
Instructions
Execute JavaScript in the page for DEBUGGING and INSPECTION only. Returns the result of the expression or last statement.
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": "javascript_tool"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript expression or statements to run. | |
| tabId | No | Tab ID to target. Omit to act on the current tab. |