Skip to main content
Glama

post_comment

Add a top-level comment to an Instagram post using the media ID and comment text, requiring manage comments permission.

Instructions

Post a top-level comment on an Instagram post. Requires instagram_manage_comments permission.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
media_idYesInstagram media ID
messageYesComment text (max 2200 characters)

Implementation Reference

  • The handler function in the client class that performs the API request to post a comment.
    async postComment(mediaId: string, message: string): Promise<IGComment> {
      const data = await this.request("POST", `${mediaId}/comments`, {
        body: { message },
      });
      return { id: data.id, text: message };
    }
  • Tool definition and input schema for post_comment.
    {
      name: "post_comment",
      description:
        "Post a top-level comment on an Instagram post. Requires instagram_manage_comments permission.",
      inputSchema: {
        type: "object" as const,
        properties: {
          media_id: { type: "string", description: "Instagram media ID" },
          message: { type: "string", description: "Comment text (max 2200 characters)", maxLength: 2200 },
        },
        required: ["media_id", "message"],
      },
    },
  • src/index.ts:427-430 (registration)
    Tool dispatch logic for "post_comment" inside handleTool.
    case "post_comment": {
      const comment = await c.postComment(args.media_id, args.message);
      return JSON.stringify(comment, null, 2);
    }

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/mcpware/instagram-mcp'

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