Skip to main content
Glama

clear_knowledge

Remove all stored knowledge from the SourceSage MCP server graph to reset or update the codebase context efficiently.

Instructions

Clear all knowledge from the graph.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • This is the implementation of the 'clear_knowledge' tool handler. It is decorated with @self.mcp.tool(), which also serves as its registration in the MCP server. The function clears the knowledge graph by creating a new empty KnowledgeGraph instance and saves it to the storage path if specified.
    @self.mcp.tool()
    def clear_knowledge() -> str:
        """Clear all knowledge from the graph."""
        self.knowledge = KnowledgeGraph()
    
        # Save empty knowledge if storage path is set
        if self.storage_path:
            self.knowledge.save_to_file(self.storage_path)
    
        return "Knowledge graph cleared successfully"

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.9/5.0
Behavior3/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 implies a destructive operation (clearing all data), but lacks details on irreversibility, permissions, or side effects. The minimal description is adequate for a simple tool but could be more informative.

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 a single concise sentence with no wasted words. It is front-loaded and easily digestible.

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 simplicity (no parameters, no output schema, no annotations), the description completely conveys the tool's purpose. The term 'graph' is likely understood from context, and no further elaboration is necessary.

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 tool has zero parameters, so per guidelines the baseline is 4. The description adds no parameter information because none exist; it is consistent with the empty input schema.

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 action: clearing all knowledge from the graph. The verb 'Clear' and resource 'all knowledge from the graph' are specific and distinguish it from sibling tools like add_entity_observation or query_entities.

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?

No guidance is provided on when to use this tool versus alternatives. It does not mention any prerequisites, consequences, or situations where clearing knowledge is appropriate, leaving the agent to infer usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools

Related Tools