Skip to main content
Glama

ig_get_conversations

Retrieve Instagram DM conversations from inbox or spam folders. Supports pagination. Requires 'instagram_manage_messages' permission.

Instructions

Get Instagram DM conversations list. Requires 'instagram_manage_messages' permission and the Instagram Messaging API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folderNoFolder to retrieve (default: inbox)
limitNoNumber of conversations
afterNoPagination cursor

Implementation Reference

  • The main handler for 'ig_get_conversations' tool. Calls `client.ig()` to fetch conversations from the Instagram Messaging API. Accepts optional `folder`, `limit`, and `after` (pagination cursor) parameters. Returns conversation data with rate limit info.
    server.tool(
      "ig_get_conversations",
      "Get Instagram DM conversations list. Requires 'instagram_manage_messages' permission and the Instagram Messaging API.",
      {
        folder: z.enum(["inbox", "spam"]).optional().describe("Folder to retrieve (default: inbox)"),
        limit: z.number().optional().describe("Number of conversations"),
        after: z.string().optional().describe("Pagination cursor"),
      },
      async ({ folder, limit, after }) => {
        try {
          const params: Record<string, unknown> = {
            platform: "instagram",
            fields: "id,updated_time,participants,messages{id,message,from,created_time}",
          };
          if (folder) params.folder = folder;
          if (limit) params.limit = limit;
          if (after) params.after = after;
          const { data, rateLimit } = await client.ig("GET", `/${client.igUserId}/conversations`, params);
          return { content: [{ type: "text", text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text", text: `Get conversations failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
        }
      }
    );
  • Zod schema for 'ig_get_conversations' input parameters: `folder` (enum: inbox/spam, optional), `limit` (number, optional), `after` (string, optional).
    {
      folder: z.enum(["inbox", "spam"]).optional().describe("Folder to retrieve (default: inbox)"),
      limit: z.number().optional().describe("Number of conversations"),
      after: z.string().optional().describe("Pagination cursor"),
    },
  • Registration via `server.tool()` call with the name 'ig_get_conversations' and description string.
    server.tool(
      "ig_get_conversations",
      "Get Instagram DM conversations list. Requires 'instagram_manage_messages' permission and the Instagram Messaging API.",
      {
        folder: z.enum(["inbox", "spam"]).optional().describe("Folder to retrieve (default: inbox)"),
        limit: z.number().optional().describe("Number of conversations"),
        after: z.string().optional().describe("Pagination cursor"),
      },
      async ({ folder, limit, after }) => {
        try {
          const params: Record<string, unknown> = {
            platform: "instagram",
            fields: "id,updated_time,participants,messages{id,message,from,created_time}",
          };
          if (folder) params.folder = folder;
          if (limit) params.limit = limit;
          if (after) params.after = after;
          const { data, rateLimit } = await client.ig("GET", `/${client.igUserId}/conversations`, params);
          return { content: [{ type: "text", text: JSON.stringify({ ...data as object, _rateLimit: rateLimit }, null, 2) }] };
        } catch (error) {
          return { content: [{ type: "text", text: `Get conversations failed: ${error instanceof Error ? error.message : String(error)}` }], isError: true };
        }
      }
    );
  • src/index.ts:48-48 (registration)
    Top-level registration: calls `registerIgMessagingTools(server, client)` which registers the tool on the MCP server.
    registerIgMessagingTools(server, client);
  • The `ig()` method on MetaClient that performs the actual HTTP request to the Instagram Graph API base URL (graph.facebook.com/v25.0). Called by the tool handler.
    async ig(
      method: string,
      path: string,
      params?: Record<string, unknown>
    ): Promise<ClientResponse> {
      if (!this.config.instagramAccessToken) {
        throw new Error("INSTAGRAM_ACCESS_TOKEN is not configured.");
      }
      return this.request(IG_BASE, this.config.instagramAccessToken, method, path, params);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden for behavioral disclosure. It only states 'Get list' without mentioning read-only nature, rate limits, pagination behavior, or response details. The 'after' cursor parameter implies pagination but is not explained, leaving significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that conveys purpose and prerequisites. It is front-loaded and scannable, with no wasted words. However, it could be slightly more structured (e.g., separate lines for permission), but overall it earns a high score.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the low parameter count (3 optional) and lack of output schema, the description is partially complete. It covers the basic purpose and authorization, but lacks details on pagination handling and response structure, which would be useful for the agent to invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage for all three parameters (folder, limit, after). The description adds no additional meaning beyond what the schema already provides, so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Get Instagram DM conversations list', specifying the verb ('get') and resource ('conversations list'). This distinguishes it from sibling tools like ig_get_message (individual message) and ig_get_messages (messages in a conversation), avoiding ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions required permissions ('instagram_manage_messages' and Instagram Messaging API), providing essential context. However, it does not specify when to use this tool over alternatives or when not to use it, leaving the agent to infer usage from the tool name.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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