ig_publish_reel
Publish Instagram Reels by uploading videos with captions, custom covers, and accessibility options. Automatically waits for video processing and can share to your feed.
Instructions
Publish a Reel (short video). Waits for video processing.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| video_url | Yes | Public HTTPS URL of the video | |
| caption | No | Reel caption | |
| cover_url | No | Custom cover image URL | |
| share_to_feed | No | Also share to feed (default true) | |
| thumb_offset | No | Thumbnail offset in ms | |
| alt_text | No | Alt text for accessibility |
Implementation Reference
- The implementation of the `ig_publish_reel` tool which handles the creation and publishing of an Instagram Reel.
server.tool( "ig_publish_reel", "Publish a Reel (short video). Waits for video processing.", { video_url: z.string().url().describe("Public HTTPS URL of the video"), caption: z.string().optional().describe("Reel caption"), cover_url: z.string().optional().describe("Custom cover image URL"), share_to_feed: z.boolean().optional().describe("Also share to feed (default true)"), thumb_offset: z.number().optional().describe("Thumbnail offset in ms"), alt_text: z.string().optional().describe("Alt text for accessibility"), }, async ({ video_url, caption, cover_url, share_to_feed, thumb_offset, alt_text }) => { try { const params: Record<string, unknown> = { video_url, media_type: "REELS" }; if (caption) params.caption = caption; if (cover_url) params.cover_url = cover_url; if (share_to_feed !== undefined) params.share_to_feed = share_to_feed; if (thumb_offset) params.thumb_offset = thumb_offset; if (alt_text) params.alt_text = alt_text; const { data: container } = await client.ig("POST", `/${client.igUserId}/media`, params); const containerId = (container as { id: string }).id; await waitForContainer(client, containerId); const { data, rateLimit } = await client.ig("POST", `/${client.igUserId}/media_publish`, { creation_id: containerId, }); return { content: [{ type: "text", text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Publish reel failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } );