upload_media
Upload an image or file to the WordPress media library from a URL or base64 data, optionally attach it to a post, and return the attachment ID and URL.
Instructions
Upload an image/file to the media library from a URL or base64 data, and optionally attach it to a post. Returns the attachment ID and URL.
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 |
|---|---|---|---|
| alt | No | ||
| url | No | Source URL to download. | |
| data | No | Base64 file data (alternative to url). | |
| title | No | ||
| filename | No | ||
| attach_to | No | Post ID to attach to. |