Skip to main content
Glama

think

Structured sequential thinking tool for biomedical research tasks. Use it before searches or analysis to ensure comprehensive understanding, optimal search strategies, and complete data synthesis in BioMCP workflows.

Instructions

REQUIRED FIRST STEP: Perform structured sequential thinking for ANY biomedical research task.

🚨 IMPORTANT: You MUST use this tool BEFORE any search or fetch operations when:
- Researching ANY biomedical topic (genes, diseases, variants, trials)
- Planning to use multiple BioMCP tools
- Answering questions that require analysis or synthesis
- Comparing information from different sources
- Making recommendations or drawing conclusions

⚠️ FAILURE TO USE THIS TOOL FIRST will result in:
- Incomplete or poorly structured analysis
- Missing important connections between data
- Suboptimal search strategies
- Overlooked critical information

Sequential thinking ensures you:
1. Fully understand the research question
2. Plan an optimal search strategy
3. Identify all relevant data sources
4. Structure your analysis properly
5. Deliver comprehensive, well-reasoned results

## Usage Pattern:
1. Start with thoughtNumber=1 to initiate analysis
2. Progress through numbered thoughts sequentially
3. Adjust totalThoughts estimate as understanding develops
4. Set nextThoughtNeeded=False only when analysis is complete

## Example:
```python
# Initial analysis
await think(
    thought="Breaking down the relationship between BRAF mutations and melanoma treatment resistance...",
    thoughtNumber=1,
    totalThoughts=5,
    nextThoughtNeeded=True
)

# Continue analysis
await think(
    thought="Examining specific BRAF V600E mutation mechanisms...",
    thoughtNumber=2,
    totalThoughts=5,
    nextThoughtNeeded=True
)

# Final thought
await think(
    thought="Synthesizing findings and proposing research directions...",
    thoughtNumber=5,
    totalThoughts=5,
    nextThoughtNeeded=False
)
```

## Important Notes:
- Each thought builds on previous ones within a session
- State is maintained throughout the MCP session
- Use thoughtful, detailed analysis in each step
- Revisions and branching are supported through the underlying implementation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nextThoughtNeededNoWhether more thinking steps are needed after this one
thoughtYesCurrent thinking step for analysis
thoughtNumberYesCurrent thought number, starting at 1
totalThoughtsYesEstimated total thoughts needed for complete analysis

Implementation Reference

  • The primary handler for the 'think' MCP tool. Defined with @mcp_app.tool() decorator, includes input schema via Annotated Fields with Pydantic Field descriptions, and implements the tool by calling mark_thinking_used() and _sequential_thinking().
    @mcp_app.tool()
    @track_performance("biomcp.think")
    async def think(
        thought: Annotated[
            str,
            Field(description="Current thinking step for analysis"),
        ],
        thoughtNumber: Annotated[
            int,
            Field(
                description="Current thought number, starting at 1",
                ge=1,
            ),
        ],
        totalThoughts: Annotated[
            int,
            Field(
                description="Estimated total thoughts needed for complete analysis",
                ge=1,
            ),
        ],
        nextThoughtNeeded: Annotated[
            bool,
            Field(
                description="Whether more thinking steps are needed after this one",
            ),
        ] = True,
    ) -> dict:
        """REQUIRED FIRST STEP: Perform structured sequential thinking for ANY biomedical research task.
    
        🚨 IMPORTANT: You MUST use this tool BEFORE any search or fetch operations when:
        - Researching ANY biomedical topic (genes, diseases, variants, trials)
        - Planning to use multiple BioMCP tools
        - Answering questions that require analysis or synthesis
        - Comparing information from different sources
        - Making recommendations or drawing conclusions
    
        ⚠️ FAILURE TO USE THIS TOOL FIRST will result in:
        - Incomplete or poorly structured analysis
        - Missing important connections between data
        - Suboptimal search strategies
        - Overlooked critical information
    
        Sequential thinking ensures you:
        1. Fully understand the research question
        2. Plan an optimal search strategy
        3. Identify all relevant data sources
        4. Structure your analysis properly
        5. Deliver comprehensive, well-reasoned results
    
        ## Usage Pattern:
        1. Start with thoughtNumber=1 to initiate analysis
        2. Progress through numbered thoughts sequentially
        3. Adjust totalThoughts estimate as understanding develops
        4. Set nextThoughtNeeded=False only when analysis is complete
    
        ## Example:
        ```python
        # Initial analysis
        await think(
            thought="Breaking down the relationship between BRAF mutations and melanoma treatment resistance...",
            thoughtNumber=1,
            totalThoughts=5,
            nextThoughtNeeded=True
        )
    
        # Continue analysis
        await think(
            thought="Examining specific BRAF V600E mutation mechanisms...",
            thoughtNumber=2,
            totalThoughts=5,
            nextThoughtNeeded=True
        )
    
        # Final thought
        await think(
            thought="Synthesizing findings and proposing research directions...",
            thoughtNumber=5,
            totalThoughts=5,
            nextThoughtNeeded=False
        )
        ```
    
        ## Important Notes:
        - Each thought builds on previous ones within a session
        - State is maintained throughout the MCP session
        - Use thoughtful, detailed analysis in each step
        - Revisions and branching are supported through the underlying implementation
        """
        # Mark that thinking has been used
        mark_thinking_used()
    
        result = await _sequential_thinking(
            thought=thought,
            thoughtNumber=thoughtNumber,
            totalThoughts=totalThoughts,
            nextThoughtNeeded=nextThoughtNeeded,
        )
    
        return {
            "domain": "thinking",
            "result": result,
            "thoughtNumber": thoughtNumber,
            "nextThoughtNeeded": nextThoughtNeeded,
        }
  • Core helper function _sequential_thinking() called by the think handler, handles validation, session management via _session_manager, creates ThoughtEntry, and returns progress status.
    async def _sequential_thinking(
        thought: Annotated[
            str, "Current thinking step - be detailed and thorough"
        ],
        nextThoughtNeeded: Annotated[
            bool, "True if more thinking needed, False only when completely done"
        ],
        thoughtNumber: Annotated[int, "Current thought number (start at 1)"],
        totalThoughts: Annotated[
            int, "Best estimate of total thoughts (adjust as needed)"
        ],
        isRevision: Annotated[
            bool, "True when correcting/improving a previous thought"
        ] = False,
        revisesThought: Annotated[
            int | None, "The thought number being revised"
        ] = None,
        branchFromThought: Annotated[
            int | None, "Create alternative path from this thought number"
        ] = None,
        needsMoreThoughts: Annotated[
            bool | None,
            "True when problem is significantly larger than initially estimated",
        ] = None,
    ) -> str:
        """
        ALWAYS use this tool for complex reasoning, analysis, or problem-solving. This facilitates a detailed, step-by-step thinking process that helps break down problems systematically.
    
        Use this tool when:
        - Analyzing complex problems or questions
        - Planning multi-step solutions
        - Breaking down tasks into components
        - Reasoning through uncertainties
        - Exploring alternative approaches
    
        Start with thoughtNumber=1 and totalThoughts as your best estimate. Set nextThoughtNeeded=true to continue thinking, or false when done. You can revise earlier thoughts or branch into alternative paths as needed.
    
        This is your primary reasoning tool - USE IT LIBERALLY for any non-trivial thinking task.
        """
    
        # Validate inputs
        if thoughtNumber < 1:
            return "Error: thoughtNumber must be >= 1"
    
        if totalThoughts < 1:
            return "Error: totalThoughts must be >= 1"
    
        if isRevision and not revisesThought:
            return "Error: revisesThought must be specified when isRevision=True"
    
        # Get or create session
        session = _session_manager.get_or_create_session()
    
        # Create thought entry
        branch_id = f"branch_{branchFromThought}" if branchFromThought else None
    
        entry = ThoughtEntry(
            thought=thought,
            thought_number=thoughtNumber,
            total_thoughts=totalThoughts,
            next_thought_needed=nextThoughtNeeded,
            is_revision=isRevision,
            revises_thought=revisesThought,
            branch_from_thought=branchFromThought,
            branch_id=branch_id,
            metadata={"needsMoreThoughts": needsMoreThoughts}
            if needsMoreThoughts
            else {},
        )
    
        # Add thought to session
        session.add_thought(entry)
    
        # Generate status message
        if branchFromThought:
            status_msg = f"Added thought {thoughtNumber} to branch '{branch_id}'"
        elif isRevision and revisesThought:
            status_msg = (
                f"Revised thought {revisesThought} (now thought {thoughtNumber})"
            )
        else:
            status_msg = f"Added thought {thoughtNumber} to main sequence"
    
        # Generate progress information
        progress_msg = f"Progress: {thoughtNumber}/{totalThoughts} thoughts"
        next_msg = (
            "Next thought needed"
            if nextThoughtNeeded
            else "Thinking sequence complete"
        )
    
        return f"{status_msg}. {progress_msg}. {next_msg}."
  • Helper function mark_thinking_used() called at the start of think handler to track thinking tool usage in the current context.
    def mark_thinking_used() -> None:
        """Mark that the thinking tool has been used."""
        thinking_used.set(True)
  • Import of the thinking_tool module, which triggers registration of the 'think' tool via its @mcp_app.tool() decorator.
    from . import thinking_tool
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 key behavioral traits: it's a stateful tool ('State is maintained throughout the MCP session'), supports sequential and branching analysis ('Revisions and branching are supported'), and outlines the consequences of misuse ('FAILURE TO USE THIS TOOL FIRST will result in...'). It doesn't cover rate limits or authentication needs, but provides substantial operational context.

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 appropriately structured with clear sections (importance, usage pattern, example, notes), but it's verbose with repetitive emphasis on mandatory usage. Sentences like 'Sequential thinking ensures you:' with a numbered list could be more concise. The front-loaded 'REQUIRED FIRST STEP' is effective, but some content could be trimmed without losing value.

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?

Given the tool's complexity (stateful thinking process) and lack of annotations/output schema, the description does a good job explaining the tool's role, workflow, and behavioral characteristics. It covers the thinking process, session state, and integration with other tools. The main gap is the absence of output information, but for a thinking tool, the description adequately compensates with usage guidance and examples.

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%, so the schema already documents all parameters. The description adds some context about parameter usage (e.g., 'Start with thoughtNumber=1', 'Adjust totalThoughts estimate as understanding develops'), but doesn't provide significant semantic meaning beyond what's in the schema descriptions. The example illustrates usage patterns but doesn't clarify parameter meanings further.

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 explicitly states the tool's purpose as 'Perform structured sequential thinking for ANY biomedical research task,' specifying the verb (structured sequential thinking) and resource (biomedical research tasks). It clearly distinguishes this from sibling tools by emphasizing it's a prerequisite thinking step before using any search/fetch operations, unlike the data retrieval siblings.

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 guidance on when to use this tool (e.g., 'BEFORE any search or fetch operations when researching ANY biomedical topic') and when not to use it (implied: not for direct data retrieval). It mentions alternatives indirectly by listing sibling tools that should follow this thinking step, establishing a clear workflow hierarchy.

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

Related 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/genomoncology/biomcp'

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