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
| Name | Required | Description | Default |
|---|---|---|---|
| media_id | Yes | Media ID to delete |
Implementation Reference
- src/tools/instagram/media.ts:50-65 (handler)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 }; } } );