wp_media_upload
Upload files to the WordPress media library using a URL or base64 data, with optional metadata for title, alt text, caption, and post attachment.
Instructions
Upload a file to the WordPress media library. Provide EITHER url (the server will fetch the URL and forward the bytes) OR data (a base64-encoded string) with filename and mime_type. Optional metadata: title, alt_text, caption, description, post (attach to a post). Max 25 MB.
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": "wp_media_upload"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| data | No | ||
| post | No | ||
| title | No | ||
| caption | No | ||
| alt_text | No | ||
| filename | No | ||
| mime_type | No | ||
| description | No |