Skip to main content
Glama

search_code

Search the current project's indexed source code by case-insensitive substring. Returns up to 10 matching code excerpts with file paths and line ranges, noting 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. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so well. It discloses read-only behavior, that results name the commit read, warns that the working copy may have moved on, advises opening the real file before trusting line numbers, and states the tool plainly reports when no code index is configured rather than returning empty results.

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 dense but every sentence earns its place: purpose, sibling routing, safety, staleness warning, error behavior, and output format are all covered without repetition. It is front-loaded with the core purpose and uses sentence-level structure that is easy for an agent to parse.

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?

There is no output schema, so the description correctly explains the return format: up to 10 snippets as path:start-end plus text, with commit context. It also covers the no-index case and the staleness caveat. For a two-parameter search tool, the description is complete enough for an agent to select and invoke it correctly.

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 both parameters. The description adds little beyond what the schema says: it mentions case-insensitive substring matching and a 10-snippet output default, but these largely mirror the schema's own descriptions. Baseline 3 is appropriate since the schema does the heavy lifting.

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 names a specific verb and resource: searches the indexed SOURCE CODE of the current project, not memory. It further clarifies the search is case-insensitive substring matching. It distinguishes itself from lookup and where_used, making sibling differentiation clear.

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?

The description explicitly states when to use lookup instead for facts stored in memory, and where_used instead for a symbol's callers. This gives direct routing guidance among siblings with no ambiguity about when this tool is the right choice.

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

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/nworks3d/THOR-memory-bible-for-AI'

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