Skip to main content
Glama

search_codebase

Search a codebase for a text pattern or regular expression to find matching files, line numbers, and code snippets.

Instructions

Searches the codebase for a text pattern or regular expression, returning matching files, line numbers, and snippets.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesText or regex pattern to search for
use_regexNoIf true, treats the query as a Regular Expression (default: false)
max_resultsNoMaximum number of results (default: 30)
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only mentions the basic output and does not disclose important traits such as case sensitivity, whether it searches filenames or content, or limitations like respecting .gitignore. This is a significant gap for a search tool.

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 a single, front-loaded sentence that efficiently conveys the tool's function and output. Every word earns its place, and there is no fluff or repetition.

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

Completeness4/5

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

The tool is simple, the schema covers all parameters, and the description explains the return format. While there is no output schema, the description mentions the key output components. It lacks minor details like result ordering or default limits, but the overall description is sufficient for a straightforward search tool.

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?

The input schema already provides 100% coverage for all parameters, including descriptions for query, use_regex, and max_results. The description adds no new meaning beyond the schema, so the baseline score of 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 verb 'searches', the resource 'codebase', and the scope 'text pattern or regular expression'. It also mentions the output format (files, line numbers, snippets), which distinguishes it from sibling tools like get_project_tree or read_project_file.

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?

The description makes the purpose clear, so it's obvious when this tool should be used, but it does not explicitly compare against alternatives or state when not to use it. No explicit exclusion or alternative guidance is provided, unlike the high-calibration example.

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/Misa714/codebase-mcp'

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