zen_js
Execute JavaScript code in the active browser tab to manipulate page content or retrieve data. Optionally target a specific tab by ID.
Instructions
Execute JavaScript in the current page context.
Args: code: JavaScript code to run (e.g. "document.title" or "document.querySelectorAll('a').length") tab_id: Optional tab to target. Defaults to active tab.
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": "zen_js"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| tab_id | No |