Upload a file
upload_fileUpload files into Foundry VTT user data, creating target directories as needed and returning a usable document path. Existing files with the same name are overwritten.
Instructions
Uploads a file from this server into Foundry's user data (images, audio, video, PDF, JSON, text), creating the directory if needed. Returns the path to use in documents. A file of the same name is overwritten.
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": {
"localPath": "<localPath>",
"dir": "<dir>"
},
"name": "upload_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dir | Yes | Directory under Data, e.g. "assets/scenes/maps/session4" | |
| name | No | File name in Foundry; defaults to the local name | |
| localPath | Yes |