Skip to main content
Glama
spences10

mcp-sequentialthinking-tools

A detailed tool for dynamic and reflective problem-solving through thoughts. This tool helps analyze problems through a flexible thinking process that can adapt and evolve. Each thought can build on, question, or revise previous insights as understanding deepens. IMPORTANT: This server facilitates sequential thinking with MCP tool coordination. The LLM analyzes available tools and their descriptions to make intelligent recommendations, which are then tracked and organized by this server. When to use this tool: - Breaking down complex problems into steps - Planning and design with room for revision - Analysis that might need course correction - Problems where the full scope might not be clear initially - Problems that require a multi-step solution - Tasks that need to maintain context over multiple steps - Situations where irrelevant information needs to be filtered out - When you need guidance on which tools to use and in what order Key features: - You can adjust total_thoughts up or down as you progress - You can question or revise previous thoughts - You can add more thoughts even after reaching what seemed like the end - You can express uncertainty and explore alternative approaches - Not every thought needs to build linearly - you can branch or backtrack - Generates a solution hypothesis - Verifies the hypothesis based on the Chain of Thought steps - Recommends appropriate tools for each step - Provides rationale for tool recommendations - Suggests tool execution order and parameters - Tracks previous recommendations and remaining steps Parameters explained: - available_mcp_tools: Array of MCP tool names that are available for use (e.g., ["mcp-omnisearch", "mcp-turso-cloud"]) - thought: Your current thinking step, which can include: * Regular analytical steps * Revisions of previous thoughts * Questions about previous decisions * Realizations about needing more analysis * Changes in approach * Hypothesis generation * Hypothesis verification * Tool recommendations and rationale - next_thought_needed: True if you need more thinking, even if at what seemed like the end - thought_number: Current number in sequence (can go beyond initial total if needed) - total_thoughts: Current estimate of thoughts needed (can be adjusted up/down) - is_revision: A boolean indicating if this thought revises previous thinking - revises_thought: If is_revision is true, which thought number is being reconsidered - branch_from_thought: If branching, which thought number is the branching point - branch_id: Identifier for the current branch (if any) - needs_more_thoughts: If reaching end but realizing more thoughts needed - current_step: Current step recommendation, including: * step_description: What needs to be done * recommended_tools: Tools recommended for this step * expected_outcome: What to expect from this step * next_step_conditions: Conditions to consider for the next step - previous_steps: Steps already recommended - remaining_steps: High-level descriptions of upcoming steps You should: 1. Start with an initial estimate of needed thoughts, but be ready to adjust 2. Feel free to question or revise previous thoughts 3. Don't hesitate to add more thoughts if needed, even at the "end" 4. Express uncertainty when present 5. Mark thoughts that revise previous thinking or branch into new paths 6. Ignore information that is irrelevant to the current step 7. Generate a solution hypothesis when appropriate 8. Verify the hypothesis based on the Chain of Thought steps 9. Consider available tools that could help with the current step 10. Provide clear rationale for tool recommendations 11. Suggest specific tool parameters when appropriate 12. Consider alternative tools for each step 13. Track progress through the recommended steps 14. Provide a single, ideally correct answer as the final output 15. Only set next_thought_needed to false when truly done and a satisfactory answer is reached

sequentialthinking_tools

Analyzes complex problems through adaptive thinking steps, recommends appropriate tools for each stage, and tracks progress toward solutions.

Instructions

A detailed tool for dynamic and reflective problem-solving through thoughts. This tool helps analyze problems through a flexible thinking process that can adapt and evolve. Each thought can build on, question, or revise previous insights as understanding deepens.

IMPORTANT: This server facilitates sequential thinking with MCP tool coordination. The LLM analyzes available tools and their descriptions to make intelligent recommendations, which are then tracked and organized by this server.

When to use this tool:

  • Breaking down complex problems into steps

  • Planning and design with room for revision

  • Analysis that might need course correction

  • Problems where the full scope might not be clear initially

  • Problems that require a multi-step solution

  • Tasks that need to maintain context over multiple steps

  • Situations where irrelevant information needs to be filtered out

  • When you need guidance on which tools to use and in what order

Key features:

  • You can adjust total_thoughts up or down as you progress

  • You can question or revise previous thoughts

  • You can add more thoughts even after reaching what seemed like the end

  • You can express uncertainty and explore alternative approaches

  • Not every thought needs to build linearly - you can branch or backtrack

  • Generates a solution hypothesis

  • Verifies the hypothesis based on the Chain of Thought steps

  • Recommends appropriate tools for each step

  • Provides rationale for tool recommendations

  • Suggests tool execution order and parameters

  • Tracks previous recommendations and remaining steps

Parameters explained:

  • available_mcp_tools: Array of MCP tool names that are available for use (e.g., ["mcp-omnisearch", "mcp-turso-cloud"])

  • thought: Your current thinking step, which can include:

  • Regular analytical steps

  • Revisions of previous thoughts

  • Questions about previous decisions

  • Realizations about needing more analysis

  • Changes in approach

  • Hypothesis generation

  • Hypothesis verification

  • Tool recommendations and rationale

  • next_thought_needed: True if you need more thinking, even if at what seemed like the end

  • thought_number: Current number in sequence (can go beyond initial total if needed)

  • total_thoughts: Current estimate of thoughts needed (can be adjusted up/down)

  • is_revision: A boolean indicating if this thought revises previous thinking

  • revises_thought: If is_revision is true, which thought number is being reconsidered

  • branch_from_thought: If branching, which thought number is the branching point

  • branch_id: Identifier for the current branch (if any)

  • needs_more_thoughts: If reaching end but realizing more thoughts needed

  • current_step: Current step recommendation, including:

  • step_description: What needs to be done

  • recommended_tools: Tools recommended for this step

  • expected_outcome: What to expect from this step

  • next_step_conditions: Conditions to consider for the next step

  • previous_steps: Steps already recommended

  • remaining_steps: High-level descriptions of upcoming steps

You should:

  1. Start with an initial estimate of needed thoughts, but be ready to adjust

  2. Feel free to question or revise previous thoughts

  3. Don't hesitate to add more thoughts if needed, even at the "end"

  4. Express uncertainty when present

  5. Mark thoughts that revise previous thinking or branch into new paths

  6. Ignore information that is irrelevant to the current step

  7. Generate a solution hypothesis when appropriate

  8. Verify the hypothesis based on the Chain of Thought steps

  9. Consider available tools that could help with the current step

  10. Provide clear rationale for tool recommendations

  11. Suggest specific tool parameters when appropriate

  12. Consider alternative tools for each step

  13. Track progress through the recommended steps

  14. Provide a single, ideally correct answer as the final output

  15. Only set next_thought_needed to false when truly done and a satisfactory answer is reached

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
available_mcp_toolsYesArray of MCP tool names available for use (e.g., ["mcp-omnisearch", "mcp-turso-cloud"])
thoughtYesYour current thinking step
next_thought_neededYesWhether another thought step is needed
thought_numberYesCurrent thought number
total_thoughtsYesEstimated total thoughts needed
is_revisionNoWhether this revises previous thinking
revises_thoughtNoWhich thought is being reconsidered
branch_from_thoughtNoBranching point thought number
branch_idNoBranch identifier
needs_more_thoughtsNoIf more thoughts are needed
current_stepNoCurrent step recommendation
previous_stepsNoSteps already recommended
remaining_stepsNoHigh-level descriptions of upcoming steps

Implementation Reference

  • The processThought method in ToolAwareSequentialThinkingServer class implements the core execution logic for the sequentialthinking_tools: processes and validates input, manages thought history and branches, formats output with JSON status including recommendations.
    public async processThought(input: v.InferInput<typeof SequentialThinkingSchema>) {
    	try {
    		// Input is already validated by tmcp with Valibot
    		const validatedInput = input as ThoughtData;
    
    		if (
    			validatedInput.thought_number > validatedInput.total_thoughts
    		) {
    			validatedInput.total_thoughts = validatedInput.thought_number;
    		}
    
    		// Store the current step in thought history
    		if (validatedInput.current_step) {
    			if (!validatedInput.previous_steps) {
    				validatedInput.previous_steps = [];
    			}
    			validatedInput.previous_steps.push(validatedInput.current_step);
    		}
    
    		this.thought_history.push(validatedInput);
    	
    	// Prevent memory leaks by limiting history size
    	if (this.thought_history.length > this.maxHistorySize) {
    		this.thought_history = this.thought_history.slice(-this.maxHistorySize);
    		console.error(`History trimmed to ${this.maxHistorySize} items`);
    	}
    
    		if (
    			validatedInput.branch_from_thought &&
    			validatedInput.branch_id
    		) {
    			if (!this.branches[validatedInput.branch_id]) {
    				this.branches[validatedInput.branch_id] = [];
    			}
    			this.branches[validatedInput.branch_id].push(validatedInput);
    		}
    
    		const formattedThought = this.formatThought(validatedInput);
    		console.error(formattedThought);
    
    		return {
    			content: [
    				{
    					type: 'text' as const,
    					text: JSON.stringify(
    						{
    							thought_number: validatedInput.thought_number,
    							total_thoughts: validatedInput.total_thoughts,
    							next_thought_needed:
    								validatedInput.next_thought_needed,
    							branches: Object.keys(this.branches),
    							thought_history_length: this.thought_history.length,
    							available_mcp_tools: validatedInput.available_mcp_tools,
    							current_step: validatedInput.current_step,
    							previous_steps: validatedInput.previous_steps,
    							remaining_steps: validatedInput.remaining_steps,
    						},
    						null,
    						2,
    					),
    				},
    			],
    		};
    	} catch (error) {
    		return {
    			content: [
    				{
    					type: 'text' as const,
    					text: JSON.stringify(
    						{
    							error:
    								error instanceof Error
    									? error.message
    									: String(error),
    							status: 'failed',
    						},
    						null,
    						2,
    					),
    				},
    			],
    			isError: true,
    		};
    	}
    }
  • Valibot schema defining the input structure for the sequentialthinking_tools, including fields for thoughts, steps, tool recommendations, branches, etc.
    export const SequentialThinkingSchema = v.object({
    	available_mcp_tools: v.pipe(
    		v.array(v.string()),
    		v.description('Array of MCP tool names available for use (e.g., ["mcp-omnisearch", "mcp-turso-cloud"])')
    	),
    	thought: v.pipe(
    		v.string(),
    		v.description('Your current thinking step')
    	),
    	next_thought_needed: v.pipe(
    		v.boolean(),
    		v.description('Whether another thought step is needed')
    	),
    	thought_number: v.pipe(
    		v.number(),
    		v.minValue(1),
    		v.description('Current thought number')
    	),
    	total_thoughts: v.pipe(
    		v.number(),
    		v.minValue(1),
    		v.description('Estimated total thoughts needed')
    	),
    	is_revision: v.optional(v.pipe(
    		v.boolean(),
    		v.description('Whether this revises previous thinking')
    	)),
    	revises_thought: v.optional(v.pipe(
    		v.number(),
    		v.minValue(1),
    		v.description('Which thought is being reconsidered')
    	)),
    	branch_from_thought: v.optional(v.pipe(
    		v.number(),
    		v.minValue(1),
    		v.description('Branching point thought number')
    	)),
    	branch_id: v.optional(v.pipe(
    		v.string(),
    		v.description('Branch identifier')
    	)),
    	needs_more_thoughts: v.optional(v.pipe(
    		v.boolean(),
    		v.description('If more thoughts are needed')
    	)),
    	current_step: v.optional(v.pipe(
    		StepRecommendationSchema,
    		v.description('Current step recommendation')
    	)),
    	previous_steps: v.optional(v.pipe(
    		v.array(StepRecommendationSchema),
    		v.description('Steps already recommended')
    	)),
    	remaining_steps: v.optional(v.pipe(
    		v.array(v.string()),
    		v.description('High-level descriptions of upcoming steps')
    	))
    });
  • src/index.ts:272-281 (registration)
    MCP server.tool registration for 'sequentialthinking_tools', providing name, description from schema export, input schema, and handler delegating to processThought.
    server.tool(
    	{
    		name: 'sequentialthinking_tools',
    		description: SEQUENTIAL_THINKING_TOOL.description,
    		schema: SequentialThinkingSchema,
    	},
    	async (input) => {
    		return thinkingServer.processThought(input);
    	},
    );
  • Constant definition and export of the tool metadata (name, description) used in registration.
    export const SEQUENTIAL_THINKING_TOOL: Tool = {
    	name: 'sequentialthinking_tools',
    	description: TOOL_DESCRIPTION,
    	inputSchema: {} // This will be handled by tmcp with the schema above
    };
  • formatThought helper formats individual thoughts with colored prefixes, borders, and includes step recommendations for console output.
    	private formatThought(thoughtData: ThoughtData): string {
    		const {
    			thought_number,
    			total_thoughts,
    			thought,
    			is_revision,
    			revises_thought,
    			branch_from_thought,
    			branch_id,
    			current_step,
    		} = thoughtData;
    
    		let prefix = '';
    		let context = '';
    
    		if (is_revision) {
    			prefix = chalk.yellow('šŸ”„ Revision');
    			context = ` (revising thought ${revises_thought})`;
    		} else if (branch_from_thought) {
    			prefix = chalk.green('🌿 Branch');
    			context = ` (from thought ${branch_from_thought}, ID: ${branch_id})`;
    		} else {
    			prefix = chalk.blue('šŸ’­ Thought');
    			context = '';
    		}
    
    		const header = `${prefix} ${thought_number}/${total_thoughts}${context}`;
    		let content = thought;
    
    		// Add recommendation information if present
    		if (current_step) {
    			content = `${thought}\n\nRecommendation:\n${this.formatRecommendation(current_step)}`;
    		}
    
    		const border = '─'.repeat(
    			Math.max(header.length, content.length) + 4,
    		);
    
    		return `
    ā”Œ${border}┐
    │ ${header} │
    ā”œ${border}┤
    │ ${content.padEnd(border.length - 2)} │
    ā””${border}ā”˜`;
    	}
Behavior4/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 effectively describes the tool's dynamic nature (e.g., adjusting thoughts, revising, branching), its role in MCP tool coordination, and expected behaviors like hypothesis generation and verification. However, it lacks details on error handling, performance limits, or authentication needs, which are minor gaps.

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

Conciseness3/5

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

The description is overly verbose and repetitive, with sections like 'Parameters explained' and 'You should' that could be condensed. While well-structured with clear headings, it includes redundant information (e.g., repeating tool features in multiple sections), reducing efficiency. Every sentence adds value, but many could be more concise.

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

Completeness5/5

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

Given the tool's high complexity (13 parameters, nested objects, no output schema, and no annotations), the description is exceptionally complete. It covers purpose, usage, features, parameter explanations, and detailed instructions, providing all necessary context for an agent to understand and invoke the tool correctly without relying on structured fields.

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

Parameters5/5

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

Despite 100% schema description coverage, the description adds significant value by explaining parameter semantics in detail. It provides context for each parameter (e.g., 'thought' can include revisions, questions, hypotheses; 'current_step' includes tool recommendations with rationale), clarifies usage patterns, and offers examples, going well beyond the schema's basic descriptions.

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

Purpose2/5

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

Tautological: description restates name/title.

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

Usage Guidelines5/5

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

The description provides explicit 'When to use this tool' with 8 bullet points covering scenarios like complex problems, planning with revision, unclear scope, multi-step solutions, and tool guidance. It also includes a 'You should' section with 15 detailed instructions on how to use the tool effectively, offering comprehensive guidance on when and how to apply it.

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/spences10/mcp-sequentialthinking-tools'

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