driftos_list_branches
View all conversation branches with their topics and message counts to analyze discussion structure and identify covered subjects.
Instructions
List all branches in a conversation with their topics and message counts.
Use this to understand the structure of a conversation and see what topics have been discussed.
Args:
conversation_id (string): Unique identifier for the conversation
Returns: [ { "id": string, "topic": string, "messageCount": number, "isActive": boolean } ]
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| conversation_id | Yes | Unique identifier for the conversation |
Implementation Reference
- src/tools/branches.ts:36-60 (handler)Handler function that executes the tool logic: calls driftClient.getBranches(conversation_id) and returns the JSON result or error.async (params) => { try { const result = await driftClient.getBranches(params.conversation_id); return { content: [ { type: 'text' as const, text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { const message = error instanceof Error ? error.message : 'Unknown error'; return { content: [ { type: 'text' as const, text: `Error listing branches: ${message}`, }, ], isError: true, }; } }
- src/tools/branches.ts:8-35 (schema)Tool schema including title, description, inputSchema with conversation_id parameter, and annotations.{ title: 'List Conversation Branches', description: `List all branches in a conversation with their topics and message counts. Use this to understand the structure of a conversation and see what topics have been discussed. Args: - conversation_id (string): Unique identifier for the conversation Returns: [ { "id": string, "topic": string, "messageCount": number, "isActive": boolean } ]`, inputSchema: z.object({ conversation_id: z.string().min(1).describe('Unique identifier for the conversation'), }).strict(), annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, },
- src/tools/branches.ts:5-62 (registration)Function that registers the driftos_list_branches tool on the MCP server.export function registerBranchTools(server: McpServer): void { server.registerTool( 'driftos_list_branches', { title: 'List Conversation Branches', description: `List all branches in a conversation with their topics and message counts. Use this to understand the structure of a conversation and see what topics have been discussed. Args: - conversation_id (string): Unique identifier for the conversation Returns: [ { "id": string, "topic": string, "messageCount": number, "isActive": boolean } ]`, inputSchema: z.object({ conversation_id: z.string().min(1).describe('Unique identifier for the conversation'), }).strict(), annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, }, async (params) => { try { const result = await driftClient.getBranches(params.conversation_id); return { content: [ { type: 'text' as const, text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { const message = error instanceof Error ? error.message : 'Unknown error'; return { content: [ { type: 'text' as const, text: `Error listing branches: ${message}`, }, ], isError: true, }; } } ); }
- src/index.ts:19-19 (registration)Call to register the branch tools (including driftos_list_branches) on the MCP server instance.registerBranchTools(server);