upload_media
Uploads a media file to WordPress from base64 data or an allowed local path, matching filename extension to MIME type and respecting size limits.
Instructions
Upload media file to WordPress. Pass either file_data (base64) or file_path. The filename extension and file content must match mime_type. Size is capped at 10 MiB; with file_data, the transport's message size limit (including base64 overhead) usually applies first
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "upload_media"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | No | Original filename; its extension must match mime_type (e.g., 'photo.jpg' for image/jpeg). Required with file_data | |
| file_data | No | Base64 encoded file data. Requires filename and mime_type. Use file_path instead for files on this machine when it is enabled | |
| file_path | No | Absolute path of a file to upload, read by the mcp-rs server. Only files inside the folders listed in the server's upload_allowed_dirs setting can be read (disabled by default). filename and mime_type default to the file's name and extension | |
| mime_type | No | MIME type of the file. Required with file_data. Allowed: image/jpeg, image/png, image/gif, image/webp, application/pdf, video/mp4, video/webm, video/ogg, audio/mpeg, audio/mp4, audio/wav, audio/ogg |