Upload media
wp_upload_mediaUploads a file to the WordPress media library from a local path or public URL, returning the media ID for use as a featured image or in content.
Instructions
Upload a file to the media library from a local path or a public URL, and get back the media ID to use as a featured image or in content.
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": {
"source": "<source>"
},
"name": "wp_upload_media"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | No | Configured site name. Omit to use the default site. | |
| title | No | ||
| source | Yes | Absolute local file path, or an http(s) URL to fetch and re-upload. | |
| caption | No | ||
| alt_text | No | Alt text — set this for images. | |
| filename | No | Override the stored filename. |