Attach a file to a file input
browser_upload_fileAttach one or more local files to a file input selected by CSS selector, using native absolute paths so Firefox can read and upload them.
Instructions
Attach one or more local files to the file input matching a CSS selector (privileged not required). IMPORTANT (measured on Windows): paths must be NATIVE (D:dirile.txt); a file:///D:/... URL is rejected with "File error: Unrecognized path". The file is read by Firefox itself, so it must exist and be readable.
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>",
"files": "<files>"
},
"name": "browser_upload_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | Native absolute paths of the files to attach | |
| context | No | Tab context id (default: the active tab) | |
| selector | Yes | CSS selector of the file input |