Skip to main content
Glama

get_stats

Retrieve detailed statistics about the indexed documents in the MCP Knowledge Base Server, including formats like PDF, DOCX, TXT, and HTML, for efficient content analysis.

Instructions

获取知识库统计信息

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

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

Implementation Reference

  • MCP tool handler for 'get_stats' that calls knowledgeBase.getStats() and formats the response as text.
    case 'get_stats': { const stats = this.knowledgeBase.getStats(); const resultText = `知识库统计信息:\n\n总文档数: ${stats.totalDocuments}\n支持格式: ${stats.supportedFormats.join(', ')}\n最大搜索结果数: ${stats.maxSearchResults}\n相似度阈值: ${stats.similarityThreshold}`; return { content: [ { type: 'text', text: resultText } ] }; }
  • Tool registration for 'get_stats' in the ListToolsRequestSchema handler, defining name, description, and empty input schema.
    { name: 'get_stats', description: '获取知识库统计信息', inputSchema: { type: 'object', properties: {} } }
  • Implementation of getStats() method in KnowledgeBase class that computes and returns the statistics.
    getStats() { return { totalDocuments: this.documents.size, supportedFormats: this.config.supportedFormats, maxSearchResults: this.config.maxSearchResults, similarityThreshold: this.config.similarityThreshold }; }

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