Skip to main content
Glama

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
NameRequiredDescriptionDefault
video_urlYesPublic HTTPS URL of the video
captionNoReel caption
cover_urlNoCustom cover image URL
share_to_feedNoAlso share to feed (default true)
thumb_offsetNoThumbnail offset in ms
alt_textNoAlt 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 };
        }
      }
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mikusnuz/meta-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server