Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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: '知识库已清空' } ] }; }
  • 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: {} } },
  • 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(); }

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/ikungsjl/mcp-knowledge-base'

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