Skip to main content
Glama

search_code

Read-onlyIdempotent

Search text or symbols beneath an absolute project directory to find code matches by query, with optional file filters and result limits.

Instructions

Search text or symbols below an absolute project directory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNotext
pathYes
queryYes
file_globNo
max_resultsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.2

TDQS

C2.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is fully covered by structured data. The description adds the scoping constraint to an absolute directory, which is useful context, but says nothing about result limits, matching behavior, or symbol mode semantics.

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?

A single efficient sentence with the scope constraint front-loaded. No waste, though it is arguably under-specified rather than optimally concise.

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

Completeness2/5

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

An output schema exists, so return values need not be described, but with 0% schema coverage and 5 parameters the description should explain mode values, file_glob, and max_results. For a search tool with multiple knobs, the definition leaves an agent guessing about half its inputs.

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

Parameters2/5

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

Schema description coverage is 0%, so the description carries the full burden, yet it only implies the 'path' (absolute directory) and 'query' parameters. It mentions text or symbols, loosely mapping to 'mode', but leaves file_glob and max_results entirely unexplained 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 description gives a specific verb ('Search') plus the resource ('text or symbols') and the scope ('below an absolute project directory'), so an agent can identify the operation immediately. It does not differentiate itself from siblings like git_diff or git_log, which search different resources, so a 4 rather than a 5.

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

Usage Guidelines2/5

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

There is no statement of when to use this tool versus alternatives, no prerequisites, and no guidance on choosing between text and symbol modes. The phrase 'below an absolute project directory' hints at the required scope but stops short of usage guidance.

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