ig_get_replies
Retrieve replies to Instagram comments using the Meta Graph API. Specify a comment ID to fetch responses, with options for pagination and result limits.
Instructions
Get replies to a specific comment.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comment_id | Yes | Comment ID to get replies for | |
| limit | No | Number of replies to return | |
| after | No | Pagination cursor |
Implementation Reference
- src/tools/instagram/comments.ts:68-89 (handler)The implementation of the `ig_get_replies` tool, which registers the tool with the MCP server and handles the API call to fetch replies for a specific Instagram comment.
server.tool( "ig_get_replies", "Get replies to a specific comment.", { comment_id: z.string().describe("Comment ID to get replies for"), limit: z.number().optional().describe("Number of replies to return"), after: z.string().optional().describe("Pagination cursor"), }, async ({ comment_id, limit, after }) => { try { const params: Record<string, unknown> = { fields: "id,text,username,timestamp,like_count", }; if (limit) params.limit = limit; if (after) params.after = after; const { data, rateLimit } = await client.ig("GET", `/${comment_id}/replies`, params); return { content: [{ type: "text", text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Get replies failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } );