Skip to main content
Glama
philogicae

sequential-thinking-mcp

think

Record thought steps for agentic problem-solving: track reasoning, suggest next tools, and list remaining tasks to decompose complex workflows.

Instructions

Logs a thought step for agentic problem-solving, tracking reasoning, tools, and future plans. Start a new thread for each user message.

Capabilities

  • Workflow Orchestration: Breaks complex tasks into manageable steps.

  • Iterative Refinement: Self-corrects based on new info or errors.

  • Tool Recommendation: Suggests specific tools for the next action.

  • Forward Planning: Tracks remaining tasks via left_to_be_done.

Args: thread_purpose: Short objective/topic for the thread. thought: Current reasoning or action description. thought_index: Monotonically increasing step number (1, 2, 3...). tool_recommendation: Tool to call next, or 'None'. left_to_be_done: Remaining steps/sub-goals, or 'None'. Returns: Confirmation of log.

Example

  1. User: "I keep hearing about central banks, but I don't understand what they are and how they work."

  2. think( thread_purpose="Explain Central Banks", thought="The user needs a comprehensive explanation of central banks. I need to identify their core definition, key roles (monetary policy, financial stability, currency issuance), and operational mechanisms (interest rates, reserves). I should search for a structured overview to ensure I don't miss major aspects like the Federal Reserve or ECB as examples.", thought_index=1, tool_recommendation="search_web", left_to_be_done="1. Search for 'how central banks work' and key functions. 2. Synthesize findings into a clear explanation. 3. Create a visual graph of the banking system structure if possible. 4. Present final answer." )

  3. call search_web(query="how central banks work and their main functions")

  4. think( thread_purpose="Explain Central Banks", thought="Search results clarify that central banks manage currency stability, control inflation via interest rates, and act as lenders of last resort. I have enough textual information. Now, to make this easier to understand, I should create a graph representing the flow of money and influence between the central bank, commercial banks, and the economy.", thought_index=2, tool_recommendation="create_graph", left_to_be_done="Create a graph showing Central Bank -> Commercial Banks -> Public/Economy relations." )

  5. call create_graph(data=...)

  6. Final Response: "Here is an explanation of central banks..." (Task complete, no further think call needed).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thread_purposeYes
thoughtYes
thought_indexYes
tool_recommendationNoNone
left_to_be_doneNoNone

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function for the 'think' tool, decorated with @mcp.tool(). It logs a thought step (thread_purpose, thought, thought_index, tool_recommendation, left_to_be_done) for agentic problem-solving and returns a confirmation string.
    @mcp.tool()
    def think(
        thread_purpose: str,
        thought: str,
        thought_index: int,
        tool_recommendation: str | None = "None",
        left_to_be_done: str | None = "None",
    ) -> str:
        """Logs a thought step for agentic problem-solving, tracking reasoning, tools, and future plans.
        Start a new thread for each user message.
    
        # Capabilities
        - Workflow Orchestration: Breaks complex tasks into manageable steps.
        - Iterative Refinement: Self-corrects based on new info or errors.
        - Tool Recommendation: Suggests specific tools for the next action.
        - Forward Planning: Tracks remaining tasks via `left_to_be_done`.
    
        Args:
            thread_purpose: Short objective/topic for the thread.
            thought: Current reasoning or action description.
            thought_index: Monotonically increasing step number (1, 2, 3...).
            tool_recommendation: Tool to call next, or 'None'.
            left_to_be_done: Remaining steps/sub-goals, or 'None'.
        Returns: Confirmation of log.
    
        # Example
        1) User: "I keep hearing about central banks, but I don't understand what they are and how they work."
        2) think(
            thread_purpose="Explain Central Banks",
            thought="The user needs a comprehensive explanation of central banks. I need to identify their core definition, key roles (monetary policy, financial stability, currency issuance), and operational mechanisms (interest rates, reserves). I should search for a structured overview to ensure I don't miss major aspects like the Federal Reserve or ECB as examples.",
            thought_index=1,
            tool_recommendation="search_web",
            left_to_be_done="1. Search for 'how central banks work' and key functions. 2. Synthesize findings into a clear explanation. 3. Create a visual graph of the banking system structure if possible. 4. Present final answer."
        )
        3) call search_web(query="how central banks work and their main functions")
        4) think(
            thread_purpose="Explain Central Banks",
            thought="Search results clarify that central banks manage currency stability, control inflation via interest rates, and act as lenders of last resort. I have enough textual information. Now, to make this easier to understand, I should create a graph representing the flow of money and influence between the central bank, commercial banks, and the economy.",
            thought_index=2,
            tool_recommendation="create_graph",
            left_to_be_done="Create a graph showing Central Bank -> Commercial Banks -> Public/Economy relations."
        )
        5) call create_graph(data=...)
        6) Final Response: "Here is an explanation of central banks..." (Task complete, no further think call needed).
        """
        log = f"Thread purpose: {thread_purpose}\nThought {thought_index} logged."
        if tool_recommendation and tool_recommendation.lower() != "none":
            log += f" Recommended tool: {tool_recommendation}."
        extra_log = f"{log}\nThought: {thought}"
        if left_to_be_done and left_to_be_done.lower() != "none":
            extra_log += f"\nNext: {left_to_be_done}"
        logger.info(extra_log)
        return log
  • Input schema/parameters for the 'think' tool, defined via function signature: thread_purpose (str), thought (str), thought_index (int), tool_recommendation (optional str), left_to_be_done (optional str).
    thread_purpose: str,
    thought: str,
    thought_index: int,
    tool_recommendation: str | None = "None",
    left_to_be_done: str | None = "None",
  • The tool is registered via the @mcp.tool() decorator on the FastMCP instance 'mcp' created at line 8.
    @mcp.tool()
  • The FastMCP server instance that hosts the 'think' tool. Configured as 'Sequential Thinking' server.
    mcp: FastMCP[Any] = FastMCP("Sequential Thinking")
    
    
    @mcp.tool()
    def think(
        thread_purpose: str,
        thought: str,
        thought_index: int,
        tool_recommendation: str | None = "None",
        left_to_be_done: str | None = "None",
    ) -> str:
        """Logs a thought step for agentic problem-solving, tracking reasoning, tools, and future plans.
        Start a new thread for each user message.
    
        # Capabilities
        - Workflow Orchestration: Breaks complex tasks into manageable steps.
        - Iterative Refinement: Self-corrects based on new info or errors.
        - Tool Recommendation: Suggests specific tools for the next action.
        - Forward Planning: Tracks remaining tasks via `left_to_be_done`.
    
        Args:
            thread_purpose: Short objective/topic for the thread.
            thought: Current reasoning or action description.
            thought_index: Monotonically increasing step number (1, 2, 3...).
            tool_recommendation: Tool to call next, or 'None'.
            left_to_be_done: Remaining steps/sub-goals, or 'None'.
        Returns: Confirmation of log.
    
        # Example
        1) User: "I keep hearing about central banks, but I don't understand what they are and how they work."
        2) think(
            thread_purpose="Explain Central Banks",
            thought="The user needs a comprehensive explanation of central banks. I need to identify their core definition, key roles (monetary policy, financial stability, currency issuance), and operational mechanisms (interest rates, reserves). I should search for a structured overview to ensure I don't miss major aspects like the Federal Reserve or ECB as examples.",
            thought_index=1,
            tool_recommendation="search_web",
            left_to_be_done="1. Search for 'how central banks work' and key functions. 2. Synthesize findings into a clear explanation. 3. Create a visual graph of the banking system structure if possible. 4. Present final answer."
        )
        3) call search_web(query="how central banks work and their main functions")
        4) think(
            thread_purpose="Explain Central Banks",
            thought="Search results clarify that central banks manage currency stability, control inflation via interest rates, and act as lenders of last resort. I have enough textual information. Now, to make this easier to understand, I should create a graph representing the flow of money and influence between the central bank, commercial banks, and the economy.",
            thought_index=2,
            tool_recommendation="create_graph",
            left_to_be_done="Create a graph showing Central Bank -> Commercial Banks -> Public/Economy relations."
        )
        5) call create_graph(data=...)
        6) Final Response: "Here is an explanation of central banks..." (Task complete, no further think call needed).
        """
        log = f"Thread purpose: {thread_purpose}\nThought {thought_index} logged."
        if tool_recommendation and tool_recommendation.lower() != "none":
            log += f" Recommended tool: {tool_recommendation}."
        extra_log = f"{log}\nThought: {thought}"
        if left_to_be_done and left_to_be_done.lower() != "none":
            extra_log += f"\nNext: {left_to_be_done}"
        logger.info(extra_log)
        return log
  • Package-level export of the MCP server (including the 'think' tool) as sequential_thinking_mcp.
    from .mcp_server import mcp as sequential_thinking_mcp
    
    __all__ = ["sequential_thinking_mcp"]
Behavior4/5

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

No annotations are provided, so the description carries full burden. It explains the tool's behavior: it logs reasoning steps, tracks `left_to_be_done`, and returns a confirmation. It does not mention side effects, but given its logging nature, none are expected. The description fully discloses what the tool does without contradicting any annotations (none present).

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 somewhat long but well-structured, with a clear opening sentence, bullet-point capabilities, an Args list, and a detailed example. Every section adds value, and the core purpose is front-loaded. While the example is extensive, it aids understanding for an orchestration tool. Minor redundancy could be trimmed, but overall it is efficient.

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 no siblings, no annotations, and an output schema present, the description covers all necessary aspects: purpose, parameters, usage example, and return value ('Confirmation of log'). It explains the workflow context and includes common patterns. The tool is fully contextualized for an AI agent to use correctly.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. The 'Args' section provides clear meanings for all five parameters: `thread_purpose` as short objective, `thought` as current reasoning, `thought_index` as step number, `tool_recommendation` as next tool, and `left_to_be_done` as remaining steps. This adds significant value beyond the raw schema, though examples could be more concisely integrated.

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 tool's purpose: 'Logs a thought step for agentic problem-solving, tracking reasoning, tools, and future plans.' It uses a specific verb ('Logs') and resource ('thought step'), and distinguishes itself from any potential siblings by detailing its unique role in workflow orchestration. No tautology or misleading information.

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 explicit usage guidance: 'Start a new thread for each user message.' It outlines capabilities (Workflow Orchestration, Iterative Refinement, etc.) that imply when the tool should be used. Although it does not specify when not to use it, the example clearly demonstrates a typical workflow. With no sibling tools, the guidance is adequate.

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/philogicae/sequential-thinking-mcp'

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