Skip to main content
Glama
DriftOS

DriftOS MCP Server

Official
by DriftOS

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
NameRequiredDescriptionDefault
conversation_idYesUnique identifier for the conversation

Implementation Reference

  • 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,
        };
      }
    }
  • 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,
          },
        },
  • 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);

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/DriftOS/driftos-mcp-server'

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