Skip to main content
Glama

think-tools

Manage MCP server connections, execute reasoning strategies, check server status, and create thought branches to enhance structured problem-solving workflows.

Instructions

Utilities for thinking workflows: connect to MCP servers, execute actions, check status, create branches

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYes
serverNameNo
commandNo
argsNo
branchIdNo
branchFromThoughtNo
thoughtNo

Implementation Reference

  • Handler for 'think-tools' MCP tool. Dispatches to actions: connect-server (connect to MCP servers), execute-actions (run pending actions), server-status (check connected servers and session state), create-branch (start new branch from existing thought). Integrates with SequentialThinkingServer instance.
    async (args) => {
      try {
        switch (args.action) {
          case "connect-server":
            if (!args.serverName || !args.command) {
              throw new Error("serverName and command required for 'connect-server' action");
            }
            
            const connectResult = await thinkingServer.connectToMCPServer(
              args.serverName, 
              args.command, 
              args.args || []
            );
            
            return {
              content: [{
                type: "text",
                text: JSON.stringify({
                  action: "connect-server",
                  ...connectResult
                }, null, 2)
              }]
            };
    
          case "execute-actions":
            const execResults = await thinkingServer.executePendingActions();
            
            return {
              content: [{
                type: "text",
                text: JSON.stringify({
                  action: "execute-actions",
                  executed: execResults.length,
                  results: execResults
                }, null, 2)
              }]
            };
    
          case "server-status":
            const status = {
              action: "server-status",
              connectedServers: thinkingServer.mcpClientManager.getConnectedServers(),
              pendingActions: thinkingServer.pendingActions.length,
              actionResults: thinkingServer.actionResults.length,
              currentSession: thinkingServer.sessionId,
              strategy: thinkingServer.strategy,
              absoluteThoughtNumber: thinkingServer.absoluteThoughtNumber,
              sequenceThoughtNumber: thinkingServer.sequenceThoughtNumber,
              branches: Object.keys(thinkingServer.branches),
              thoughtHistory: thinkingServer.thoughtHistory.length
            };
            
            return {
              content: [{
                type: "text",
                text: JSON.stringify(status, null, 2)
              }]
            };
    
          case "create-branch":
            if (!args.branchId || !args.branchFromThought || !args.thought) {
              throw new Error("branchId, branchFromThought, and thought required for 'create-branch' action");
            }
            
            // Find the source thought
            const sourceThought = thinkingServer.thoughtHistory.find(
              t => t.absoluteNumber === args.branchFromThought
            );
            
            if (!sourceThought) {
              throw new Error(`No thought found with absolute number ${args.branchFromThought}`);
            }
            
            // Create branching thought data
            const branchData = {
              thought: args.thought,
              branchFromThought: args.branchFromThought,
              branchId: args.branchId,
              thoughtNumber: 1,
              totalThoughts: 5, // Default estimate
              nextThoughtNeeded: true,
              strategy: thinkingServer.strategy
            };
            
            // Process the branch creation
            const branchResult = await thinkingServer.processThought(branchData);
            
            return {
              content: [{
                type: "text",
                text: JSON.stringify({
                  action: "create-branch",
                  message: `Branch '${args.branchId}' created from thought A${args.branchFromThought}`,
                  branchResult: branchResult
                }, null, 2)
              }]
            };
    
          default:
            throw new Error(`Unknown action: ${args.action}`);
        }
      } catch (error) {
        console.error(`ERROR: Think-tools action '${args.action}' failed:`, error);
        throw error;
      }
    }
  • Zod input schema defining parameters for 'think-tools'. Required 'action' enum, optional params for each sub-action like serverName for connect-server, branchId/thought/branchFromThought for create-branch.
    {
      action: z.enum(["connect-server", "execute-actions", "server-status", "create-branch"]),
      serverName: z.string().optional(),
      command: z.string().optional(),
      args: z.array(z.string()).optional(),
      branchId: z.string().optional(),
      branchFromThought: z.number().optional(),
      thought: z.string().optional()
    },
  • index.js:1739-1857 (registration)
    MCP server.tool() registration of the 'think-tools' tool with description, Zod schema, and handler function.
    server.tool(
      "think-tools",
      "Utilities for thinking workflows: connect to MCP servers, execute actions, check status, create branches",
      {
        action: z.enum(["connect-server", "execute-actions", "server-status", "create-branch"]),
        serverName: z.string().optional(),
        command: z.string().optional(),
        args: z.array(z.string()).optional(),
        branchId: z.string().optional(),
        branchFromThought: z.number().optional(),
        thought: z.string().optional()
      },
      async (args) => {
        try {
          switch (args.action) {
            case "connect-server":
              if (!args.serverName || !args.command) {
                throw new Error("serverName and command required for 'connect-server' action");
              }
              
              const connectResult = await thinkingServer.connectToMCPServer(
                args.serverName, 
                args.command, 
                args.args || []
              );
              
              return {
                content: [{
                  type: "text",
                  text: JSON.stringify({
                    action: "connect-server",
                    ...connectResult
                  }, null, 2)
                }]
              };
    
            case "execute-actions":
              const execResults = await thinkingServer.executePendingActions();
              
              return {
                content: [{
                  type: "text",
                  text: JSON.stringify({
                    action: "execute-actions",
                    executed: execResults.length,
                    results: execResults
                  }, null, 2)
                }]
              };
    
            case "server-status":
              const status = {
                action: "server-status",
                connectedServers: thinkingServer.mcpClientManager.getConnectedServers(),
                pendingActions: thinkingServer.pendingActions.length,
                actionResults: thinkingServer.actionResults.length,
                currentSession: thinkingServer.sessionId,
                strategy: thinkingServer.strategy,
                absoluteThoughtNumber: thinkingServer.absoluteThoughtNumber,
                sequenceThoughtNumber: thinkingServer.sequenceThoughtNumber,
                branches: Object.keys(thinkingServer.branches),
                thoughtHistory: thinkingServer.thoughtHistory.length
              };
              
              return {
                content: [{
                  type: "text",
                  text: JSON.stringify(status, null, 2)
                }]
              };
    
            case "create-branch":
              if (!args.branchId || !args.branchFromThought || !args.thought) {
                throw new Error("branchId, branchFromThought, and thought required for 'create-branch' action");
              }
              
              // Find the source thought
              const sourceThought = thinkingServer.thoughtHistory.find(
                t => t.absoluteNumber === args.branchFromThought
              );
              
              if (!sourceThought) {
                throw new Error(`No thought found with absolute number ${args.branchFromThought}`);
              }
              
              // Create branching thought data
              const branchData = {
                thought: args.thought,
                branchFromThought: args.branchFromThought,
                branchId: args.branchId,
                thoughtNumber: 1,
                totalThoughts: 5, // Default estimate
                nextThoughtNeeded: true,
                strategy: thinkingServer.strategy
              };
              
              // Process the branch creation
              const branchResult = await thinkingServer.processThought(branchData);
              
              return {
                content: [{
                  type: "text",
                  text: JSON.stringify({
                    action: "create-branch",
                    message: `Branch '${args.branchId}' created from thought A${args.branchFromThought}`,
                    branchResult: branchResult
                  }, null, 2)
                }]
              };
    
            default:
              throw new Error(`Unknown action: ${args.action}`);
          }
        } catch (error) {
          console.error(`ERROR: Think-tools action '${args.action}' failed:`, error);
          throw error;
        }
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions actions like 'connect to MCP servers' and 'execute actions' but doesn't clarify permissions needed, side effects, rate limits, or what 'check status' and 'create branches' entail in terms of behavior. This leaves significant gaps for a tool with multiple potential operations.

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 concise and front-loaded with a list of utilities, using a single sentence without unnecessary words. However, it could be more structured by explicitly linking actions to parameters or providing clearer categorization.

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 7 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It doesn't adequately explain how to use the tool, what each action does, or what to expect in return, making it insufficient for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and 7 parameters, the description does not add any meaning beyond the input schema. It lists actions but doesn't explain how parameters like serverName, command, args, branchId, branchFromThought, or thought relate to those actions, failing to compensate for the lack of schema documentation.

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

Purpose3/5

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

The description lists four utilities (connect to MCP servers, execute actions, check status, create branches) which gives a general idea of what the tool does, but it's vague about the specific verb+resource combinations and doesn't distinguish from sibling tools like think-session-manager or think-strategies. It states 'Utilities for thinking workflows' which is somewhat helpful but lacks specificity.

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 its siblings (think-session-manager, think-strategies), nor does it specify contexts or exclusions for its different actions. It merely lists functions without indicating appropriate scenarios or alternatives.

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/aaronsb/think-strategies'

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