Tools

Codebase Indexing

The codebase indexing tool walks a file tree, extracts symbols from source files, and builds a semantic search index. Supports TypeScript, JavaScript, Python, Go, Rust, and Java. Agents can search by symbol name, type signature, or natural language description.

Indexing a codebase

Send a POST /tools/codebase-index request with a path to start indexing. The tool walks the directory recursively, extracts symbols from each supported file, and writes vector embeddings to the search index.

bash
curl -X POST http://localhost:3000/tools/codebase-index \
  -H 'Authorization: Bearer $JWT_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"path": "/workspace/my-project"}'

Supported languages

LanguageExtensionsSymbol types extracted
TypeScript.ts, .tsxFunctions, classes, interfaces, type aliases, enums, exported constants
JavaScript.js, .jsx, .mjsFunctions, classes, exported constants
Python.pyFunctions, classes, methods, module-level assignments
Go.goFunctions, methods, structs, interfaces, type declarations
Rust.rsFunctions, structs, enums, traits, impl blocks
Java.javaClasses, interfaces, methods, enums, annotations

Searching

Once a codebase is indexed, agents can query it with POST /tools/codebase-search. Searches support free-text queries, an optional type filter to restrict results to a symbol kind, and a glob filter to narrow by file path.

bash
curl -X POST http://localhost:3000/tools/codebase-search \
  -H 'Authorization: Bearer $JWT_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": "function that handles user authentication",
    "type": "function",
    "glob": "src/auth/**"
  }'
ParameterTypeRequiredDescription
querystringYesNatural language description, symbol name, or type signature to search for
typestringNoFilter by symbol kind: function, class, interface, type, enum, method
globstringNoRestrict results to files matching this glob pattern (e.g. src/api/**)
limitnumberNoMaximum number of results to return (default: 10)

Configuration

yaml
tools:
  codebaseIndexing:
    enabled: true
    excludePatterns:
      - node_modules/**
      - dist/**
      - .git/**
      - '**/*.min.js'
    languages:
      - typescript
      - javascript
      - python
      - go
      - rust
      - java
The index is incrementally updated on file change if the workspace watcher is enabled. Only modified files are re-parsed and re-embedded, keeping indexing overhead minimal during active development.