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
| Name | Required | Description | Default |
|---|---|---|---|
| media_id | Yes | Instagram media ID | |
| message | Yes | Comment text (max 2200 characters) |
Implementation Reference
- src/client.ts:480-485 (handler)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 }; } - src/index.ts:229-241 (schema)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); }