Upload file
upload_fileUpload a local file to a page's file input via CDP, avoiding OS file picker dialogs. Resolves the real input from a uid and reports upload success.
Instructions
Attach a local file to a file input on the page.
Sets the input's files directly over CDP, so no OS file-picker dialog ever opens — clicking an upload button normally would open one, and that blocks every further tool call until a human dismisses it.
Chrome renders a file input with an internal shadow button, and that is what the accessibility tree exposes, so the uid you can see is usually not the input itself. This resolves to the real input: the element, one inside it, the input a label controls, or one just above in the tree.
The result is read back. If the page's own uploader consumed the file straight away, the response says so, which is a successful upload rather than an empty input.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | uid of the file input, or of the button, label or drop zone in front of it — the real <input type="file"> is resolved from there. Comes from the most recent take_snapshot. | |
| browser | No | Which browser to act on. Each name is an independent Chrome, created on first use. Omit for the shared default; parallel agents each need their own name. | default |
| file_path | Yes | Absolute path to a local file on the machine running this server. | |
| include_snapshot | No | Append a fresh page snapshot to the response. Worth it when this action changes the page and take_snapshot would be your next call anyway — it saves a round trip, at the cost of a much larger response. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |