drop_file
Simulate file drop operations in Electron apps by dispatching synthetic drag/drop events with file contents for testing and automation purposes.
Instructions
Simulate dropping a file onto a target element by dispatching synthetic drag/drop events with a DataTransfer containing the file contents. Works for apps that read File via web APIs (FileReader, File.text, etc.). Does NOT populate file.path — apps that rely on webUtils.getPathForFile() or legacy file.path must use eval_main to invoke their IPC directly.
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": {
"filePath": "<filePath>"
},
"name": "drop_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Absolute path to a local file. | |
| selector | No | CSS selector of the drop target. Defaults to document.body. | |
| mimeType | No | MIME type for the synthesized File object. Default text/plain. |