list_conversations
Retrieve all active XMTP conversations to manage and interact with decentralized messaging network participants effectively.
Instructions
List all active XMTP conversations
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:382-408 (handler)The primary handler function for the 'list_conversations' tool. Checks if XMTP client is connected, lists all conversations using client.conversations.list(), maps to id and createdAt, and returns formatted JSON response in MCP content format.private async listConversations() { if (!this.state.client) { throw new Error("XMTP client not connected. Use connect_xmtp tool first."); } try { const conversations = await this.state.client.conversations.list(); const conversationList = conversations.map((conv) => { return { id: conv.id, createdAt: conv.createdAt?.toISOString(), } }); return { content: [ { type: "text", text: JSON.stringify(conversationList, null, 2), }, ], }; } catch (error) { throw new Error(`Failed to list conversations: ${error}`); } }
- src/index.ts:169-176 (registration)Registration of the 'list_conversations' tool in the ListToolsRequestSchema handler. Defines the tool name, description, and input schema (no required parameters).{ name: "list_conversations", description: "List all active XMTP conversations", inputSchema: { type: "object", properties: {}, }, },
- src/index.ts:172-175 (schema)Input schema definition for the 'list_conversations' tool, specifying an empty object (no input parameters required).inputSchema: { type: "object", properties: {}, },
- src/index.ts:223-224 (registration)Dispatch routing in the CallToolRequestSchema handler that routes calls to the 'list_conversations' tool to its handler method.case "list_conversations": return await this.listConversations();