Skip to main content
Glama

get_index_stats

Retrieve read-only knowledge base index statistics and health metrics to inspect document/chunk counts, embedding status, BM25 state, cache hit rate, and HNSW recall.

Instructions

Get statistics and health metrics for the knowledge base index.

Read-only. No side effects.

Returns: JSON string with system metrics: total documents, total chunks, embedding model name, BM25 status, query cache hit rate, file watcher status, a self_recall probe (fraction of sampled chunks returned as top-1 by their own stored vector; a value below 1.0 means the HNSW index misses some chunks — see search.ef_search in config.example.yaml), and hnsw_ef_search (the value ChromaDB actually applies to the live collection; it can lag behind search.ef_search until a full rebuild).

Usage: Use for system health checks — inspecting embedding runtime status, checking index population, or monitoring cache efficiency. This does not load the embedding model or initialize BM25. Use list_categories() for per-category document counts instead. Use evaluate_retrieval() to measure actual search quality with test queries.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_index_stats"
  }
}

Input Schema

NameRequiredDescriptionDefault

No arguments

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden: it declares 'Read-only. No side effects.' and clarifies that it does not load the embedding model or initialize BM25. It also explains the self_recall metric and a caveat about hnsw_ef_search lagging behind config. However, it omits potential operational details like authentication requirements or rate limits, which keeps it from a 5.

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?

Front-loaded with the core purpose, followed by structured sections (Returns, Usage). The returns section is somewhat lengthy but each detail (self_recall, hnsw_ef_search lag) adds useful context. Slight verbosity keeps it from a 5.

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

Completeness5/5

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

Given a no-parameter stats tool with an output schema, the description covers what the tool does, what it does not do, alternatives, and interpretation of key metrics (self_recall). It is complete enough for an agent to select and call the tool correctly.

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 zero parameters, so the baseline is 4. The description does not need to add parameter meaning, and none is missing.

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

Purpose4/5

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

States a specific verb and resource: 'Get statistics and health metrics for the knowledge base index.' Clear but not as sharp as a scope-constrained sibling example; it does not explicitly define the boundaries of the index (e.g., what is included/excluded) in the first sentence.

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

Usage Guidelines5/5

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

Explicitly lists when to use (health checks, inspecting embedding runtime, checking index population, monitoring cache efficiency), states what it does not do (does not load embedding model or initialize BM25), and names two alternatives (list_categories for per-category counts, evaluate_retrieval for search quality). Comprehensive guidance with no gaps.

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