Skip to main content
Glama

index_codebase

Index a codebase directory to enable semantic code search. Scans files and extracts functions, classes, and blocks into an in-memory search index.

Instructions

Index a codebase directory for semantic code search. Scans files, extracts functions/classes/blocks, and builds an in-memory search index.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rootDirNoRoot directory to index (default: current working directory)
extensionsNoFile extensions to index (default: .ts, .js, .py, .go, .rs, etc.)
ignorePatternsNoDirectory names to ignore (default: node_modules, .git, dist, etc.)
Behavior3/5

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

With no annotations, the description must fully convey behavioral traits. It mentions building an in-memory index, which is a key trait, but does not state that it is a read-only operation, whether it modifies files, or potential performance implications. The description adds some behavioral context but leaves gaps.

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?

The description is two sentences with no wasted words. It is front-loaded with the primary action and provides additional detail efficiently.

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?

The description lacks information about the output of the tool (e.g., success message, index identifier) and does not explicitly mention that the index is used by the sibling 'code_search' tool. While it mentions the purpose, the absence of output schema and return value details leaves some contextual gaps.

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 100%, so the schema already documents parameters. The description adds no additional meaning about parameters beyond what the schema provides. Baseline 3 is appropriate.

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 clearly states the tool indexes a codebase for semantic code search, specifying it scans files, extracts functions/classes/blocks, and builds an in-memory search index. This distinguishes it from sibling 'code_search' which would query the index.

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

Usage Guidelines4/5

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

The description implies the tool is a prerequisite for code_search, but does not explicitly state when to use it versus alternatives or when not to use it. The sibling tool name 'code_search' provides context, but the description could be more explicit about the dependency.

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/JNZader/mcp-llm-bridge'

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