Skip to main content
Glama

ig_post_comment

Add a comment to Instagram posts using the Meta MCP server. Specify media ID and message to post top-level comments.

Instructions

Post a top-level comment on a media post.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
media_idYesMedia ID to comment on
messageYesComment text

Implementation Reference

  • The `ig_post_comment` tool implementation, including schema definition and request handler logic.
    server.tool(
      "ig_post_comment",
      "Post a top-level comment on a media post.",
      {
        media_id: z.string().describe("Media ID to comment on"),
        message: z.string().describe("Comment text"),
      },
      async ({ media_id, message }) => {
        try {
          const { data, rateLimit } = await client.ig("POST", `/${media_id}/comments`, { message });
          return { content: [{ type: "text", text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text", text: `Post comment 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