get_stats
Retrieve statistics about the Retrieval-Augmented Generation system's performance and usage metrics to monitor and analyze its operational data.
Instructions
Get statistics about the RAG system
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/index.ts:458-467 (handler)MCP tool handler for 'get_stats': fetches statistics from RAGService and formats as JSON response.private async handleGetStats() { const stats = await this.ragService.getStats(); return { content: [ { type: 'text', text: JSON.stringify(stats, null, 2), }, ], };
- src/index.ts:188-195 (registration)Tool registration in ListToolsRequestHandler, including name, description, and empty input schema.{ name: 'get_stats', description: 'Get statistics about the RAG system', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:191-194 (schema)Input schema for 'get_stats' tool (no required parameters).inputSchema: { type: 'object', properties: {}, },
- src/services/ragService.ts:222-233 (helper)RAGService.getStats() method that delegates to vectorDatabase for collection statistics.async getStats(): Promise<{ documents: number; memory: number; total: number; }> { try { return await this.vectorDatabase.getCollectionStats(); } catch (error) { logger.error(`Error getting stats: ${error}`); return { documents: 0, memory: 0, total: 0 }; } }