get_conversation_messages
Retrieve messages from an Instagram direct message conversation using the conversation ID, with optional limit control for message quantity.
Instructions
Get messages from a specific Instagram DM conversation. Requires instagram_manage_messages permission.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| conversation_id | Yes | Instagram conversation ID | |
| limit | No | Number of messages (max 100) |
Implementation Reference
- src/client.ts:439-452 (handler)The implementation of the get_conversation_messages tool logic in the client.
async getConversationMessages( conversationId: string, limit = 25 ): Promise<IGMessage[]> { const fields = "id,from,to,message,created_time,attachments"; const data = await this.request("GET", conversationId, { params: { fields: `messages{${fields}}`, limit: String(Math.min(limit, 100)), }, useFacebookApi: true, }); return data.messages?.data ?? []; } - src/index.ts:190-200 (registration)The MCP tool registration for get_conversation_messages.
name: "get_conversation_messages", description: "Get messages from a specific Instagram DM conversation. Requires instagram_manage_messages permission.", inputSchema: { type: "object" as const, properties: { conversation_id: { type: "string", description: "Instagram conversation ID" }, limit: { type: "integer", description: "Number of messages (max 100)", minimum: 1, maximum: 100, default: 25 }, }, required: ["conversation_id"], },