Skip to main content
Glama

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
NameRequiredDescriptionDefault
comment_idYesComment ID to get replies for
limitNoNumber of replies to return
afterNoPagination cursor

Implementation Reference

  • 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 };
        }
      }
    );

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