browser_upload_file
Upload local files to a web page's file input by giving a file path and optional snapshot ref or CSS selector, or auto-detect the first file input; works on strict-CSP pages.
Instructions
Upload a file through a file input element. Uses CDP DOM.setFileInputFiles — works even on strict-CSP pages. Provide the local file path and either a ref from snapshot, a CSS selector targeting the file input, or omit both to auto-find the first input[type="file"].
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "browser_upload_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Element reference from snapshot (e.g. "e12") | |
| files | No | Array of local file paths to upload (multiple files) | |
| filePath | No | Local file path to upload (single file) | |
| selector | No | CSS selector for the file input element |