Skip to main content
Glama

ig_delete_media

Remove Instagram posts, carousels, reels, or stories permanently using the Instagram Graph API. This irreversible action requires instagram_manage_contents permission.

Instructions

Delete an Instagram media post (posts, carousels, reels, stories). This action is irreversible. Requires instagram_manage_contents permission.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
media_idYesMedia ID to delete

Implementation Reference

  • The `ig_delete_media` tool is registered and implemented within `src/tools/instagram/media.ts` using the `server.tool` method. It takes a `media_id` input and performs a DELETE request to the Instagram graph API.
    // ─── ig_delete_media ─────────────────────────────────────────
    server.tool(
      "ig_delete_media",
      "Delete an Instagram media post (posts, carousels, reels, stories). This action is irreversible. Requires instagram_manage_contents permission.",
      {
        media_id: z.string().describe("Media ID to delete"),
      },
      async ({ media_id }) => {
        try {
          const { data, rateLimit } = await client.ig("DELETE", `/${media_id}`);
          return { content: [{ type: "text", text: JSON.stringify({ success: true, ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text", text: `Delete media 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