safari_upload_file
Upload a file directly to an HTML file input via JavaScript DataTransfer—no file dialog or UI interaction. Optionally verify image previews before publishing.
Instructions
Upload a file to a element via JavaScript DataTransfer — NO file dialog, NO UI interaction. IMPORTANT: Do NOT click the file input before calling this tool — just provide the selector and file path. If a file dialog is already open, this tool will close it first. NOTE: 'verified 0 files' may appear even on success if the site uses a custom upload handler — check visually with safari_snapshot. For an IMAGE going into a composer/editor that should show a thumbnail, pass verifyPreview:true — some sites (Google Business Profile) accept the file handle and flip their UI to 'attached' while ingesting nothing, and the post then publishes with no image.
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>",
"filePath": "<filePath>"
},
"name": "safari_upload_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| why | No | Optional short purpose of this step, shown to the user in the cursor's status pill (e.g. 'to save the settings'). The page can read it: never put passwords, codes, card numbers or other private data in it. | |
| receipt | No | Omit it: Daylight has no tab receipts and refuses a call that passes one | |
| filePath | Yes | Absolute path to the file to upload | |
| selector | Yes | CSS selector of the file input | |
| forceNative | No | Skip synthetic injection and go straight to the real OS file dialog (isTrusted). Needs an unlocked screen and briefly focuses Safari. Use when the site is known to reject synthetic uploads. | |
| verifyPreview | No | Require a visible preview (blob:/data: image) to appear; if none does, the synthetic pickup was a ghost and this escalates to a real OS file dialog. Use for images going into a composer. |