Skip to main content
Glama

clear_knowledge_base

Easily clear indexed documents and data from the knowledge base on the MCP Knowledge Base Server, enabling a reset or fresh start for document processing and querying tasks.

Instructions

清空知识库

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • MCP tool handler for 'clear_knowledge_base' that calls the KnowledgeBase.clear() method and returns a success message.
    case 'clear_knowledge_base': { await this.knowledgeBase.clear(); return { content: [ { type: 'text', text: '知识库已清空' } ] }; }
  • Registration of the 'clear_knowledge_base' tool in the ListTools response, including its schema (empty input).
    { name: 'clear_knowledge_base', description: '清空知识库', inputSchema: { type: 'object', properties: {} } },
  • Core helper method in KnowledgeBase class that clears the in-memory documents map and persists the empty state to index file.
    async clear(): Promise<void> { this.documents.clear(); await this.saveIndex(); }

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

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