get_index_stats
Retrieve statistics about the knowledge base index to monitor its size, structure, and content distribution for RAG system management.
Instructions
Get statistics about the knowledge base index.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp_server/server.py:1242-1257 (handler)The get_stats method within the KnowledgeOrchestrator class calculates and returns the index statistics.
def get_stats(self) -> Dict[str, Any]: """Get index statistics""" return { "total_documents": len(self._indexed_docs), "total_chunks": self.collection.count(), "unique_content_hashes": len(self._chunk_hashes), "categories": self.list_categories(), "supported_formats": config.supported_formats, "embedding_model": config.embedding_model, "embedding_dim": config.embedding_dim, "reranker_model": config.reranker_model if config.reranker_enabled else "disabled", "chunk_size": config.chunk_size, "chunk_overlap": config.chunk_overlap, "query_cache": self.query_cache.stats(), } - mcp_server/server.py:1411-1416 (registration)Registration of the get_index_stats MCP tool, which calls the orchestrator's get_stats method.
def get_index_stats() -> str: """Get statistics about the knowledge base index.""" orchestrator = get_orchestrator() stats = orchestrator.get_stats() return json.dumps({"status": "success", "stats": stats}, indent=2)