Skip to main content
Glama

get_stats

Retrieve statistical information about indexed documents in the knowledge base, including counts and processing status for various file formats.

Instructions

获取知识库统计信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that returns statistics for the knowledge base: total documents, supported formats, max search results, and similarity threshold.
    getStats() { return { totalDocuments: this.documents.size, supportedFormats: this.config.supportedFormats, maxSearchResults: this.config.maxSearchResults, similarityThreshold: this.config.similarityThreshold }; }
  • Registration of the 'get_stats' tool in the ListTools response, including name, description, and empty input schema.
    { name: 'get_stats', description: '获取知识库统计信息', inputSchema: { type: 'object', properties: {} } }
  • MCP CallTool handler for 'get_stats', which calls knowledgeBase.getStats() and formats the response as text content.
    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 } ] }; }
  • Input schema for get_stats tool: an empty object (no parameters required).
    inputSchema: { type: 'object', properties: {} }

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