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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/knowledge-base.ts:209-216 (handler)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 }; }
- src/mcp-server.ts:142-149 (registration)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: {} } }
- src/mcp-server.ts:294-306 (handler)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 } ] }; }
- src/mcp-server.ts:145-148 (schema)Input schema for get_stats tool: an empty object (no parameters required).inputSchema: { type: 'object', properties: {} }