Skip to main content
Glama
DriftOS

DriftOS MCP Server

Official
by DriftOS

List Conversation Branches

driftos_list_branches
Read-onlyIdempotent

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);
Behavior3/5

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

Annotations already provide comprehensive behavioral hints (read-only, non-destructive, idempotent, closed-world). The description adds useful context about the tool's purpose in analyzing conversation structure, but doesn't disclose additional behavioral traits like rate limits, authentication needs, or pagination behavior beyond what annotations cover.

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 well-structured with purpose first, usage guidance second, and parameter/return details last. However, the Args section duplicates schema information unnecessarily, and the Returns section could be more concise given there's no output schema.

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

Completeness4/5

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

For a read-only list operation with comprehensive annotations and a simple single parameter, the description provides adequate context. The return format is documented, and the purpose is clear. However, without an output schema, the description could benefit from more detail about the structure of returned branches.

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?

Schema description coverage is 100% with the parameter clearly documented. The description repeats the same parameter information in the Args section without adding additional semantic context beyond what's in the schema. This meets the baseline for high schema coverage.

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 the verb 'List' and resource 'all branches in a conversation' with specific details about what information is returned ('topics and message counts'). It distinguishes from siblings by focusing on conversation structure analysis rather than prompt building, fact extraction, or message routing.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool ('to understand the structure of a conversation and see what topics have been discussed'), which helps differentiate it from sibling tools. However, it doesn't explicitly state when NOT to use it or name specific alternatives among the siblings.

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

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