Skip to main content
Glama

search_code

Read-onlyIdempotent

Find code snippets in the current project's indexed source using a case-insensitive substring search. Returns up to 10 matches with file paths and line ranges, along with the commit context.

Instructions

Code lane: searches the indexed SOURCE CODE of the current project, not the memory - a case-insensitive substring search. Use lookup instead for facts stored in memory, or where_used for one symbol's callers. Read-only. Every answer names the commit the text was read at and whether the working copy has since moved on - open the real file before trusting a line number. States plainly when no code index is configured, rather than returning an empty result. Replies with up to 10 matching snippets as path:start-end plus text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMost hits to return. Defaults to 10.
queryYesCase-insensitive substring to find in the indexed source.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover read-only, idempotent, and non-destructive behavior, so the description adds significant extra context: every result names the commit read, warns that the working copy may have moved on, advises opening the file before trusting line numbers, and states it reports a missing config instead of returning an empty result. This goes well beyond the structured annotations.

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?

The description is front-loaded with the core purpose and each sentence contributes a distinct fact. The only minor redundancy is 'Read-only', which repeats the readOnlyHint annotation, and the 'Code lane' opener adds little; otherwise it is tightly structured.

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

Completeness5/5

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

With only two simple parameters and no output schema, the description fully covers what an agent needs: return value shape, staleness caveats, missing-index behavior, and result limits. Nothing important is left out.

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 schema already describes both parameters fully, including defaults and case-insensitivity, so the baseline is 3. The description adds the result format and the 'up to 10' cap, but it mostly echoes what the schema already provides rather than adding new parameter-level meaning.

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 opens with a specific verb and resource: 'searches the indexed SOURCE CODE of the current project'. It also explicitly distinguishes itself from memory lookups and names the sibling tools lookup and where_used, so an agent can immediately tell this tool apart from its alternatives.

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

Usage Guidelines5/5

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

It gives explicit routing guidance: 'Use lookup instead for facts stored in memory, or where_used for one symbol's callers.' This clearly states when to choose this tool versus its siblings and leaves no ambiguity about the selection criteria.

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