Run an ego-browser script
ego_runRuns custom ESM Node scripts in the embedded ego-browser runtime, enabling top-level await and ego browser APIs to automate tasks beyond shortcut tools and return structured JSON data.
Instructions
Run an ego-browser (ego lite) Node script with the embedded runtime. The script is ESM with top-level await and can use taskSpace(name), task.page('p1'), page.goto(), page.snapshot(), page.click('ref=12') and the rest of the ego API. Print JSON to return structured data. Use this for anything the shortcut tools do not cover.
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": "ego_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | Full ESM script text, executed by `ego-browser nodejs`. | |
| timeoutMs | No | Hard timeout, default 120000. |