clear_knowledge_base
Remove all indexed documents from the MCP Knowledge Base Server to reset the knowledge base for new content processing.
Instructions
清空知识库
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp-server.ts:282-292 (handler)Handler for the 'clear_knowledge_base' tool call. Invokes KnowledgeBase.clear() and returns a success message indicating the knowledge base has been cleared.case 'clear_knowledge_base': { await this.knowledgeBase.clear(); return { content: [ { type: 'text', text: '知识库已清空' } ] }; }
- src/mcp-server.ts:134-141 (registration)Registration of the 'clear_knowledge_base' tool in the ListTools response, defining its name, description, and empty input schema.{ name: 'clear_knowledge_base', description: '清空知识库', inputSchema: { type: 'object', properties: {} } },
- src/knowledge-base.ts:178-181 (helper)Core implementation of clearing the knowledge base: empties the in-memory documents Map and persists the empty state by calling saveIndex().async clear(): Promise<void> { this.documents.clear(); await this.saveIndex(); }