ig_get_mentioned_comments
Retrieve Instagram comments where your account was mentioned to monitor engagement and respond directly from the Meta MCP server.
Instructions
Get comments where the account was @mentioned. Returns the media and comment details.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comment_id | Yes | Comment ID from a mention notification | |
| fields | No | Fields to return (default: id,text,timestamp,username,media) |
Implementation Reference
- src/tools/instagram/mentions.ts:7-26 (handler)The handler function for 'ig_get_mentioned_comments' tool which calls the Instagram API via the MetaClient.
server.tool( "ig_get_mentioned_comments", "Get comments where the account was @mentioned. Returns the media and comment details.", { comment_id: z.string().describe("Comment ID from a mention notification"), fields: z.string().optional().describe("Fields to return (default: id,text,timestamp,username,media)"), }, async ({ comment_id, fields }) => { try { const f = fields || "id,text,timestamp,username,media{id,media_url,media_type}"; const { data, rateLimit } = await client.ig("GET", `/${client.igUserId}/mentioned_comment`, { comment_id, fields: f, }); return { content: [{ type: "text", text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Get mentioned comments failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } ); - src/tools/instagram/mentions.ts:5-5 (registration)The registration function 'registerIgMentionTools' where the 'ig_get_mentioned_comments' tool is added to the McpServer.
export function registerIgMentionTools(server: McpServer, client: MetaClient): void {