publish_reel
Upload short-form videos to Instagram from a public URL in MP4 format. Add captions and control feed sharing to publish Reels.
Instructions
Publish a Reel (short-form video) to Instagram. Video must be publicly accessible URL, MP4 format.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| video_url | Yes | URL of the video to publish as Reel | |
| caption | No | Caption for the Reel (optional) | |
| share_to_feed | No | Also share to main feed (default: true) |
Implementation Reference
- src/client.ts:345-363 (handler)The core implementation of the publish_reel tool logic.
async publishReel( videoUrl: string, caption?: string, shareToFeed = true ): Promise<IGPublishResult> { const id = this.aid(); const body: Record<string, any> = { media_type: "REELS", video_url: videoUrl, share_to_feed: String(shareToFeed), }; if (caption) body.caption = caption; const container = await this.request("POST", `${id}/media`, { body }); const result = await this.request("POST", `${id}/media_publish`, { body: { creation_id: container.id }, }); return { id: result.id }; } - src/index.ts:127-140 (registration)Tool definition and schema registration for publish_reel.
{ name: "publish_reel", description: "Publish a Reel (short-form video) to Instagram. Video must be publicly accessible URL, MP4 format.", inputSchema: { type: "object" as const, properties: { video_url: { type: "string", format: "uri", description: "URL of the video to publish as Reel" }, caption: { type: "string", description: "Caption for the Reel (optional)" }, share_to_feed: { type: "boolean", description: "Also share to main feed (default: true)", default: true }, }, required: ["video_url"], }, }, - src/index.ts:380-383 (handler)Dispatcher logic in index.ts that calls the handler.
case "publish_reel": { const result = await c.publishReel(args.video_url, args.caption, args.share_to_feed ?? true); return JSON.stringify(result, null, 2); }