Skip to main content
Glama
fmangot

Sequential Thinking MVP Server

by fmangot

get_thought_branch

Retrieve a specific branch of alternative reasoning paths to explore different approaches to complex problems during structured analysis.

Instructions

Retrieves a specific branch of alternative reasoning paths

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchIdYesThe identifier of the branch to retrieve
sessionIdNoOptional session ID (defaults to current session)

Implementation Reference

  • The core handler logic for the 'get_thought_branch' tool. It validates the required 'branchId' parameter, retrieves the specific thought branch using the SequentialThinkingManager, and formats the response as MCP content with JSON-serialized branch details including thought count and thoughts.
    case 'get_thought_branch': {
      const { branchId, sessionId } = args as { branchId: string; sessionId?: string };
    
      if (!branchId) {
        throw new ValidationError('branchId is required');
      }
    
      const branch = thinkingManager.getBranch(branchId, sessionId);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(
              {
                branchId,
                thoughtCount: branch.length,
                thoughts: branch,
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • The input schema and metadata definition for the 'get_thought_branch' tool, specifying required 'branchId' and optional 'sessionId' parameters.
    export const GET_BRANCH_TOOL: Tool = {
      name: 'get_thought_branch',
      description: 'Retrieves a specific branch of alternative reasoning paths',
      inputSchema: {
        type: 'object',
        properties: {
          branchId: {
            type: 'string',
            description: 'The identifier of the branch to retrieve',
          },
          sessionId: {
            type: 'string',
            description: 'Optional session ID (defaults to current session)',
          },
        },
        required: ['branchId'],
      },
    };
  • src/index.ts:32-34 (registration)
    Registration of tool list handler that returns ALL_TOOLS array, which includes the 'get_thought_branch' tool schema.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools: ALL_TOOLS };
    });
  • src/index.ts:37-39 (registration)
    Registration of the generic tool call handler that dispatches to handleToolCall, which contains the specific logic for 'get_thought_branch'.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      return handleToolCall(request.params, thinkingManager);
    });
  • Tool list registration in HTTP server, exposing 'get_thought_branch' via ALL_TOOLS.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools: ALL_TOOLS };
    });
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves data, implying a read-only operation, but doesn't clarify if it's safe, requires authentication, has rate limits, or what happens on errors. This leaves significant gaps for a tool with potential complexity in handling reasoning paths.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without any fluff. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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

Completeness2/5

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

Given the complexity of handling 'alternative reasoning paths' and the lack of annotations and output schema, the description is incomplete. It doesn't explain what a 'branch' entails, the return format, or how it relates to sibling tools, leaving the agent with insufficient context for effective use.

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, with clear documentation for 'branchId' and 'sessionId'. The description adds no additional parameter semantics beyond what the schema provides, such as format examples or constraints. However, the baseline is 3 since the schema adequately covers the parameters.

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

Purpose4/5

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

The description clearly states the tool's purpose with a specific verb ('Retrieves') and resource ('a specific branch of alternative reasoning paths'), making it immediately understandable. However, it doesn't differentiate from sibling tools like 'get_thought_sequence' or 'get_session_summary', which might have overlapping retrieval functions, so it doesn't achieve full distinction.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_thought_sequence' or 'get_session_summary', nor does it specify prerequisites or exclusions, leaving the agent to infer usage from the name alone.

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/fmangot/Mcp'

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