upload_media
Uploads an image, video, PDF, or other media file to WordPress from base64 data and returns the attachment ID for use as featured media.
Instructions
Upload a media file (image, video, PDF, etc.) to WordPress. Provide file data as base64-encoded string. Returns the attachment ID which can be used as featured_media on posts.
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>",
"data": "<data>"
},
"name": "upload_media"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Base64-encoded file content | |
| title | No | Media title | |
| caption | No | Media caption | |
| alt_text | No | Alt text for images (accessibility) | |
| filename | Yes | Filename with extension (e.g., 'photo.jpg', 'document.pdf') | |
| description | No | Media description |