Skip to main content
Glama

clear_thoughts

Remove recorded thoughts from the MCP Agile Flow server, optionally filtered by category. Helps manage and streamline AI-assisted agile development workflows.

Instructions

Clear recorded thoughts.

This tool removes previously recorded thoughts, optionally filtered by category. If no category is specified, all thoughts will be cleared.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter to clear thoughts from a specific category only

Implementation Reference

  • Primary handler function that clears thoughts from the global ThoughtStorage instance, computes the number cleared, and returns a success response with details.
    def clear_thoughts(category: Optional[str] = None) -> Dict[str, Any]:
        """Clear recorded thoughts."""
        count_before = len(_storage.get_thoughts())
        _storage.clear_thoughts(category)
        count_after = len(_storage.get_thoughts())
        count_cleared = count_before - count_after
    
        message = f"Cleared {count_cleared} recorded thoughts"
        if category:
            message += f" in category '{category}'."
        else:
            message += "."
    
        return {"success": True, "message": message, "thoughts_cleared": count_cleared}
  • MCP tool registration using @mcp.tool() decorator. Includes input schema definition via pydantic Field for the optional 'category' parameter. Delegates execution to the imported clear_thoughts_impl and serializes the result to JSON.
    @mcp.tool()
    def clear_thoughts(
        category: Optional[str] = Field(
            description="Filter to clear thoughts from a specific category only", default=None
        ),
    ) -> str:
        """
        Clear recorded thoughts.
    
        This tool removes previously recorded thoughts, optionally filtered by category.
        If no category is specified, all thoughts will be cleared.
        """
        # Extract actual value if it's a Field object
        if hasattr(category, "default"):
            category = category.default
    
        result = clear_thoughts_impl(category)
        return json.dumps(result, indent=2)
  • Pydantic Field definition providing input schema/validation and description for the 'category' parameter of the clear_thoughts tool.
        category: Optional[str] = Field(
            description="Filter to clear thoughts from a specific category only", default=None
        ),
    ) -> str:
  • Helper method in ThoughtStorage class that performs the actual clearing/filtering of thoughts list in memory and persists to temporary JSON file.
    def clear_thoughts(self, category: Optional[str] = None):
        """Clear stored thoughts, optionally by category."""
        if category:
            self._thoughts = [t for t in self._thoughts if t.get("category") != category]
        else:
            self._thoughts = []
        self._save()
Behavior3/5

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

With no annotations provided, the description carries full burden. It clearly discloses the destructive behavior ('removes', 'cleared') and the optional filtering capability. However, it lacks details about permissions needed, whether deletion is reversible, confirmation prompts, or rate limits. The behavioral disclosure is adequate but minimal.

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 perfectly concise: three sentences with zero waste. The first states the core action, the second explains the parameter's role, and the third clarifies the default case. Each sentence earns its place by adding critical information, and the structure is front-loaded with the main purpose.

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

Completeness3/5

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

Given no annotations and no output schema, the description adequately covers the tool's destructive nature and parameter logic. However, for a mutation tool, it lacks details on error conditions, success responses, or side effects. It's minimally complete but leaves gaps an agent might need, such as what 'cleared' means operationally.

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?

The schema has 100% description coverage, so the baseline is 3. The description adds value by explaining the parameter's effect: 'If no category is specified, all thoughts will be cleared' clarifies the default behavior beyond the schema's 'Filter to clear thoughts from a specific category only'. This semantic context elevates the score above baseline.

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 verb ('Clear'/'removes') and resource ('recorded thoughts'), making the purpose immediately understandable. It distinguishes the tool's destructive nature from sibling tools like 'get_thoughts' (read-only) and 'think' (creation). However, it doesn't explicitly contrast with all siblings, so it falls short of a perfect 5.

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

Usage Guidelines3/5

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

The description implies when to use it (to remove thoughts) and provides conditional logic (with/without category filter), but doesn't explicitly state when NOT to use it or name alternatives. For example, it doesn't contrast with 'get_thoughts' for viewing thoughts or warn against accidental deletion. This leaves some ambiguity for the agent.

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/smian0/mcp-agile-flow'

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