Browser Evaluate
browser_evaluateExecutes JavaScript in the browser page context to run custom scripts and return JSON-serialized results; use SAP-specific tools first when they cover the task.
Instructions
Execute JavaScript in the browser. Use with caution - this has full access to the page context. Prefer SAP-specific tools when available. Returns: JSON-serialized result.
Session parameter:
session=None (default): Uses primary session ("s1")
session="s2": Targets specific session (for parallel agents)
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": "browser_evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | JavaScript code to execute. | |
| session | No | Session ID (e.g., "s1", "s2"). None uses primary session. | |
| agent_id | No | Agent identifier for binding check. Optional. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Error message if success=False | |
| popup | No | Present when a popup dialog is active on screen | |
| result | No | JSON-serialized result | |
| success | No | Whether the operation succeeded | |
| active_window | No | Which window was operated on (e.g., 'wnd[0]', 'wnd[1]'). If 'wnd[1]' or higher, a modal dialog is open. | |
| script_snippet | No | First 100 chars of script |