Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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: {},
      },
    },
  • Input schema for 'get_stats' tool (no required parameters).
    inputSchema: {
      type: 'object',
      properties: {},
    },
  • 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 };
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states it 'gets' statistics, implying a read-only operation, but doesn't disclose behavioral traits such as what statistics are included, if it requires authentication, rate limits, or how data is formatted. This leaves significant gaps in understanding the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence: 'Get statistics about the RAG system.' It is front-loaded and wastes no words, making it appropriately concise. However, it could be slightly more informative without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a statistics tool with no annotations and no output schema, the description is incomplete. It doesn't explain what statistics are returned, their format, or any prerequisites. For a tool that likely provides detailed data, this leaves the agent without enough context to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description doesn't add parameter semantics, but with no parameters, this is acceptable. Baseline is 4 as per rules for 0 parameters, indicating the description adequately handles the lack of inputs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get statistics about the RAG system' clearly states the action (get) and target (statistics about RAG system), which is adequate. However, it doesn't differentiate from sibling tools like 'test_connection' or 'get_memory_by_agent' that might also provide system information, making it vague about what specific statistics are retrieved.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't specify if this is for monitoring, debugging, or if other tools like 'test_connection' or 'search_memory' should be used for related purposes. The lack of context leaves the agent without clear usage instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/santis84/mcp-rag'

If you have feedback or need assistance with the MCP directory API, please join our Discord server