Skip to main content
Glama

Search code

search_code
Read-only

Find where a string appears in the code of the repositories connected to a project, with the file, the line number and the lines around it. Only repositories whose owners opened them to agents are searched, and the answer says when what it searched was out of date.

Input Schema

NameRequiredDescriptionDefault
pathNoNarrow to files whose path contains this, such as 'src/' or '.ts'.
repoNoWhich repository, as 'group/repo'. Omit to search every repository open here.
queryYesWhat to look for, taken literally unless regexp is set. A space is a space, not two terms.
regexpNoRead query as a regular expression. One with no literal in it may not finish in time.
caseSensitiveNoMatch case. Off by default.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, non-destructive, closed-world), so the description's value is in the extra context it adds: the search scope is restricted to repositories whose owners opened them to agents, and results flag staleness of the index. That is real behavioral information not present in structured fields, though rate limits or result caps are unmentioned.

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?

Two sentences, front-loaded with what the tool finds and what it returns, followed by the scoping caveat. No filler and no repetition of the title.

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?

With no output schema, the description responsibly describes the return content (file, line number, surrounding lines) and the staleness caveat. The only real gap is guidance on how this differs from the other code tools in the sibling list.

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 coverage is 100%, so every parameter including query literal-vs-regexp, path narrowing, repo scoping and caseSensitive is already documented in the schema. The description adds no syntax or format guidance beyond that, so baseline 3 applies.

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 names a specific verb and resource ('Find where a string appears in the code of repositories connected to a project') and even previews the return shape (file, line number, surrounding lines). It never names or contrasts with lookalike siblings such as read_code, code_symbols, code_calls or list_code, so an agent must infer which of the code tools to pick.

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?

Usage is only implied: it tells you only agent-opened repositories are searched, which shapes expectations but does not say when to choose this over code_symbols (symbol lookup) or read_code (whole file read). No explicit when-not or alternative routing is given.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources