Skip to main content
Glama
ikungsjl

MCP Knowledge Base Server

by ikungsjl

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();
    }
Behavior1/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. '清空知识库' implies a destructive mutation (clearing), but it doesn't specify whether this action is reversible, requires special permissions, affects system performance, or has confirmation steps. For a potentially high-impact tool with zero annotation coverage, this lack of behavioral context is a critical gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single phrase '清空知识库', which is extremely brief. While conciseness is valued, this under-specifies the tool's function—it lacks necessary context about behavior, usage, or effects. Every sentence should earn its place, but here the minimal content fails to provide adequate information, making it inefficient rather than appropriately concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's likely complexity (a destructive clear operation) and the absence of both annotations and an output schema, the description is incomplete. It doesn't explain what 'clear' entails (e.g., deletion of all documents, resetting statistics), what happens post-operation, or any error conditions. For a high-stakes tool with no structured support, the description should do more to inform safe and correct use.

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 input schema has 0 parameters with 100% coverage, meaning no parameters are documented in the schema. The description doesn't add parameter details, but since there are no parameters to explain, this is acceptable. The baseline for 0 parameters is 4, as the description doesn't need to compensate for missing parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '清空知识库' (Clear knowledge base) is a tautology that essentially restates the tool name 'clear_knowledge_base' in Chinese. While it indicates the action (clear) and target (knowledge base), it doesn't provide any additional specificity about what 'clear' entails or how this differs from sibling tools like 'remove_document' or 'query_knowledge_base'. The purpose is recognizable but minimally differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., whether the knowledge base must exist), exclusions (e.g., irreversible effects), or comparisons to sibling tools like 'remove_document' (for deleting individual items) or 'list_documents' (for viewing contents). Users are left to infer usage context entirely on their own.

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

Install Server

Other 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