Skip to main content
Glama

get_index_stats

Obtain detailed metrics on code index health, including file counts, symbol distributions, embedding model, and database size. Use to debug search quality or monitor index freshness.

Instructions

USE THIS TOOL to get comprehensive statistics about the code index.

This tool provides detailed metrics about the index health, including file counts, symbol distributions, embedding model info, and database size.

TRIGGER - Call this tool when:

  • You want to understand what's in the index

  • Debugging search quality issues

  • Checking index freshness or coverage

  • Monitoring database size and health

Do NOT use this tool for:

  • Checking if indexing is needed (use check_index_status)

  • Searching for code (use search_code)

Args: directory: Path to the project directory.

Returns: Dictionary with: - indexed: boolean - true if anything has been indexed - counts: Symbol, file, chunk, and embedding counts - distributions: Symbol kinds and file extensions - freshness: Last indexed timestamps - embedding: Model name and dimension - database: Size, journal mode, and WAL status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directoryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations provided, so description carries full burden. It details the return dictionary structure and fields, indicating it is a read-only operation. It does not mention performance or side effects, but for a stats tool this is sufficient. No contradictions.

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

Conciseness5/5

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

Description is front-loaded with 'USE THIS TOOL' and structured into when/why, args, returns. Every sentence adds value; no fluff or repetition. Length is appropriate.

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 one parameter and stated output schema existence, the description covers all necessary aspects: purpose, usage, parameter, and return structure. It is complete for the tool's complexity.

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?

Schema has 0% description coverage for parameters; the description compensates by clearly stating 'directory: Path to the project directory.' This adds meaning beyond the schema's minimal type definition. For one parameter, this is adequate.

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

Purpose5/5

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

The description explicitly states the tool's purpose: to get comprehensive statistics about the code index. It lists specific metrics like file counts, symbol distributions, and database size. It distinguishes itself from siblings by noting what not to use it for (check_index_status, search_code).

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?

Provides clear when-to-use scenarios: understanding index, debugging search quality, checking freshness, monitoring database. Also gives explicit when-not-to-use examples and directs to alternative tools.

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/kapillamba4/code-memory'

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