add_media
Store files in the media library and append them to posts, in one call.
Exactly one source: file, url / urls, upload, or media_ids /
media_urls (already in the library, from list_media).
attach_to_post_ids lists every post it goes on; nothing already there is
removed (attach_media sets the exact list). The result names the posts
that got it (attached), those that did not and why (notAttached), and
those that still cannot publish (publishBlockers). A file is never read
into the call as base64.
PNG, JPEG, GIF, WebP, AVIF images up to 10 MB (converted to the platform's
format at publish, so never re-export one); MP4, MOV, WebM video and PDF up
to 1 GB by upload, 100 MB by url or file.
Shorts, Reels, TikToks and stories are vertical (9:16) video, made vertical from the start: a landscape video shrunk onto a blurred or padded vertical frame reads as a repost, so make a vertical cut instead. On YouTube only a vertical or square video of three minutes or less is a Short.
Args:
file: A file the user attached to a ChatGPT conversation. ChatGPT
fills it in and Antwork downloads it; it is never synthesized.
ChatGPT's mobile apps send no usable file, which the result says.
url: Public HTTPS URL of the file (e.g. an AI-generated image already
hosted), or a Google Drive, Docs, Slides, Dropbox or OneDrive share
link as the user copied it. Antwork downloads it.
urls: Up to 10 such links in one call, e.g. a carousel's slides, in
order; results has one entry per link. If any fails, none is
attached (stored ones are in results).
upload: A file in a shell or code-execution sandbox: {} returns a
one-time uploadUrl (10 minutes), and
curl -sS -X PUT --data-binary @<path> '<uploadUrl>' stores and
attaches it; that response is the result. mime_type and
byte_size are optional.
media_ids: Library media ids to add to the posts.
media_urls: Library media URLs to add to the posts.
attach_to_post_ids: Every post to add the media to.
workspace_id: Workspace ID or name. Optional if the user has only one.
fit: "crop" (centre) or "pad" (blurred background): each image on
attach_to_post_ids whose aspect ratio the post's platform
refuses is replaced by a copy at the nearest ratio it takes (the
original stays in the library; fitted lists the copies).
Images only. With no source, it fits the posts' current media.
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": "add_media"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fit | No | ||
| url | No | ||
| file | No | ||
| urls | No | ||
| upload | No | ||
| context | No | The user's underlying goal for this call, in one sentence without personal details. Used for product analytics only. | |
| llm_model | No | The model identifier of the calling assistant, or "unknown". Used for product analytics only. | |
| media_ids | No | ||
| media_urls | No | ||
| workspace_id | No | ||
| conversation_id | No | Pass the exact conversation_id from the server's previous response, unchanged. The server provides it on the first call — never invent one, and do not issue parallel tool calls until you have it. Keep passing the same conversation_id for the rest of the conversation, including after later user messages or on a different task; do not reset it when the user starts a new request. | |
| attach_to_post_ids | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| _mcp_instructions | No | Server-issued metadata for this conversation. |