upload_file
Attaches local files from permitted directories to a browser file input or file chooser button, then fires change events so automated upload flows can proceed.
Instructions
Set files on a file input (or its label, or an element holding one; on Chromium also a button that opens a file chooser) and fire change events. Files must be in the working or temp directory or MCP_BROWSER_UPLOAD_DIRS. Returns changes.
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": {
"selector": "<selector>",
"paths": "<paths>"
},
"name": "upload_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paths | Yes | Absolute file paths; [] clears the input. | |
| selector | Yes | Locator: ref=e3, CSS, text=…, role=button[name="…"], name=…, or a >> b | |
| sessionId | No | ||
| timeoutMs | No | ms to retry while the element is missing (default 2000). |