Skip to main content
Glama

index_directory

Indexes code files in a directory using tree-sitter chunking, creating a local .gogo/index.db for per-codebase search while respecting ignore rules.

Instructions

Index all code files in a directory using tree-sitter chunking.
Creates a .gogo/index.db in the directory for per-codebase indexing.

Respects .gogoignore file if present, plus built-in defaults for:
- Build directories (node_modules, dist, public, .next, etc.)
- Minified files (*.min.js, *.bundle.*, etc.)
- Lock files (package-lock.json, yarn.lock, etc.)
- Generated files (*.generated.*, *.pb.go, etc.)

Performance: Uses parallel tree-sitter parsing for faster indexing.

Args:
    directory: Path to directory to index (index stored at directory/.gogo/index.db)
    extensions: Comma-separated file extensions to index (default: auto-detect all supported)

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "directory": "<directory>"
    },
    "name": "index_directory"
  }
}

Input Schema

NameRequiredDescriptionDefault
directoryYes
extensionsNo
max_workersNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does useful work by disclosing the on-disk artifact (.gogo/index.db), the .gogoignore contract, and the built-in exclusion defaults. However, it never says what happens if an index already exists (overwrite, merge, or incremental), how long indexing takes, or whether writes could fail — significant omissions for an operation that mutates a codebase directory.

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?

Well front-loaded: purpose first, then behavioral contract (ignore rules), then performance note, then Args. The exclusion bullet list is longer than strictly necessary but each category conveys concrete, actionable exclusion semantics rather than filler.

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

Completeness3/5

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

Return values need not be explained since an output schema exists, and the ignore-rule and storage details cover most of what an agent needs. What is missing is the critical lifecycle behavior — what happens to a pre-existing index and what max_workers controls — which matters for a potentially long-running write operation with no annotations.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must compensate. It documents 'directory' with its storage location and 'extensions' with its comma-separated format and auto-detect default, which is real added meaning. The third parameter, max_workers, is never mentioned, leaving one of three params undocumented in both schema and description.

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?

The opening sentence states a specific verb and resource — indexing all code files in a directory via tree-sitter chunking — and adds the concrete side effect of creating .gogo/index.db. It is clearly distinguishable from siblings like sync_index or clear_index, though it never names them explicitly.

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

Usage Guidelines3/5

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

Usage is implied: this is the tool to reach for when establishing a fresh per-codebase index. There is no explicit statement of when to prefer sync_index, clear_index, or watch_directory instead, nor any prerequisite or exclusion guidance.

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