Skip to main content
Glama

get_conversations

Retrieve conversation lists and participant information from Instagram or Facebook inboxes to manage messaging interactions.

Instructions

Get list of conversations/inbox for Instagram or Facebook. Returns conversation IDs and participant info.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
platformYesPlatform to get conversations from
folderNoInbox folder (default: inbox)

Implementation Reference

  • MCP server handler for the 'get_conversations' tool: parses arguments using the schema and delegates to the Facebook API function.
    case 'get_conversations': {
      const params = GetConversationsSchema.parse(args);
      result = await api.getConversations(params.platform, params.folder);
      break;
    }
  • Core implementation that makes the Graph API call to fetch conversations for the specified platform and folder.
    export async function getConversations(
      platform: 'instagram' | 'facebook',
      folder: 'inbox' | 'other' = 'inbox'
    ): Promise<{ data: Conversation[] }> {
      const platformParam = platform === 'instagram' ? 'INSTAGRAM' : 'MESSENGER';
    
      return makeApiCall({
        endpoint: `/${config.fbPageId}/conversations`,
        params: {
          platform: platformParam,
          folder,
          fields: 'id,can_reply,message_count,participants'
        }
      });
    }
  • Zod schema for validating input parameters to the get_conversations tool.
    const GetConversationsSchema = z.object({
      platform: z.enum(['instagram', 'facebook']),
      folder: z.enum(['inbox', 'other']).optional()
    });
  • src/index.ts:136-146 (registration)
    Tool registration in the MCP server's listTools handler, defining name, description, and input schema.
      name: 'get_conversations',
      description: 'Get list of conversations/inbox for Instagram or Facebook. Returns conversation IDs and participant info.',
      inputSchema: {
        type: 'object',
        properties: {
          platform: { type: 'string', enum: ['instagram', 'facebook'], description: 'Platform to get conversations from' },
          folder: { type: 'string', enum: ['inbox', 'other'], description: 'Inbox folder (default: inbox)' }
        },
        required: ['platform']
      }
    },
  • TypeScript interface defining the structure of a conversation object returned by the tool.
    export interface Conversation {
      id: string;
      can_reply?: boolean;
      message_count?: number;
      participants?: { data: Array<{ id: string; name?: string; username?: string }> };
    }

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/osborn1997/instagram-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server