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.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "clear_knowledge"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- sourcesage/mcp_server.py:505-514 (handler)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"