open_file
Opens a local file on an existing sandbox instance's display using a specified app or the default handler; resolves relative paths in the staging folder for viewing or testing files.
Instructions
Open a local file in an app ON an existing instance's display (NOT a new instance).
If app is given, runs <app> <filepath> there (e.g. app='gimp'); otherwise xdg-open picks
the default handler. Relative paths resolve against the instance's staging folder files//
(see list_files). Returns {"ok", "action", "instance", "opened", "app"}; fails (isError) if
the file or the app doesn't exist, or if the handler exits immediately (e.g. xdg-open finds
no application for that file type — then pass app=). The app is started asynchronously —
wait_for_stable()/screenshot after a moment to confirm it drew. For BROWSER
uploads use upload_file() instead. Both paths get the same X11 + D-Bus handling as launch_app
(so the app renders on this display, not in an already-running window on the host).
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": {
"filepath": "<filepath>"
},
"name": "open_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | No | ||
| filepath | Yes | ||
| instance | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |