uploadFile
Upload files to Directus CMS using the MCP Server by providing a file URL, base64 data, and metadata. Supports file storage, naming, and MIME type specification for efficient file management.
Instructions
Upload a file to Directus
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": {
"fileName": "<fileName>"
},
"name": "uploadFile"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fileData | No | Base64 encoded file data (either fileUrl or fileData must be provided) | |
| fileName | Yes | Name of the file | |
| fileUrl | No | URL of the file to upload (either fileUrl or fileData must be provided) | |
| mimeType | No | MIME type of the file | |
| storage | No | Storage location (optional) | |
| title | No | File title (optional) | |
| token | No | Authentication token (default from config) | |
| url | No | Directus API URL (default from config) |