Skip to main content
Glama

search_code

Search source files for a case-insensitive text substring to find where code is defined or used. Get matching file paths, line numbers, and text snippets.

Instructions

Searches for a plain-text substring across readable project files.

Case-insensitive. Returns matching locations as {project, path, line, text}. Use it to locate where something is defined or used without having to open files one by one.

Args: query: Text to look for, e.g. "SecurityLevel" or "def safe_resolve". project: Optional - restrict the search to a single project. max_results: Cap on the number of matches returned.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
projectNo
max_resultsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

The description discloses key behavioral details: case-insensitivity, return format ({project, path, line, text}), and scope ('readable project files'). It also mentions max_results as a cap. Since no annotations are provided, this transparency is essential and adequately covers the main behavior.

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 compact and front-loaded with the core purpose, followed by a clear Args block. Each sentence serves a purpose without redundancy, making it easy to scan and understand.

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 description covers purpose, parameters, and behavior well, and the presence of an output schema reduces the need to explain return values. Minor omissions like handling of no matches or error cases are acceptable, but the description could be slightly more complete given no annotations.

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

Parameters5/5

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

The description adds significant meaning to each parameter: query gets examples, project is described as restricting to a single project, and max_results is described as a cap. The schema only provides titles and defaults (0% description coverage), so this parameter documentation is vital and well-executed.

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's function: 'Searches for a plain-text substring across readable project files.' It also provides concrete examples ('SecurityLevel', 'def safe_resolve') and distinguishes itself from siblings by focusing on search rather than listing or reading files.

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 explicitly says to use it 'to locate where something is defined or used without having to open files one by one,' which gives clear context. However, it does not explicitly name alternatives or provide when-not-to-use conditions, so it stops short of full exclusions.

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/lduda79/projects-mcp'

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