upload_file
Attach a local file to a browser page's file input via Chrome DevTools Protocol, bypassing the sandbox's invisible native picker that hangs the renderer.
Instructions
Attach a local file to a page's via Chrome DevTools Protocol — use this for ALL browser uploads (logos, images, docs).
The sandbox's native GTK file picker is invisible to us AND hangs the renderer, so never click
an upload button expecting a dialog — call this instead. Works on Chromium-family browsers
started by launch_app / start-display.sh (they open a per-instance --remote-debugging-port,
9222+N). selector targets the file input on the MAIN page (default = first file input).
With several tabs open the most recently active page target is used unless page_url_contains
picks the tab by a URL fragment. If the site only inserts the after you click its
'upload' control, click that first (it won't open a dialog we can see, but it wires up the
input), then call this. Relative paths resolve against files//.
Returns {"ok", "action", "instance", "detail", "page"}; fails (isError) with the reason if the
file is missing, no CDP target answers, or the selector matches nothing.
NATIVE (non-browser) apps: use open_file() or drive the app's own Open dialog — it IS visible
here. observe/settle_ms: see click().
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": "upload_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| observe | No | none | |
| filepath | Yes | ||
| instance | No | ||
| selector | No | input[type=file] | |
| settle_ms | No | ||
| observe_region | No | ||
| page_url_contains | No |