Skip to main content
Glama

search_code

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

TableJSON 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
Behavior3/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It discloses two useful behaviors: the search is limited to repositories whose owners have opened them to agents, and the response indicates when the searched data was out of date. However, it does not explicitly state that the tool is read-only (though implied), nor does it mention rate limits, pagination, or result limits.

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 two sentences with no filler. It front-loads the core purpose ('Find where a string appears in the code') and then adds the important scope and freshness behaviors. Every sentence earns its place.

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?

No output schema exists, but the description explains the return format (file, line number, surrounding lines) and key contextual constraints (project repositories, agent-opened repos, staleness note). It lacks details about result ordering or limits, but the description is complete enough for an agent to understand what the tool does and how to invoke it.

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 baseline is 3. The description does not add meaning to parameters like path, repo, regexp, or caseSensitive beyond what the schema already provides. It mentions 'string' which maps to query, but no additional semantic detail is offered.

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 states a specific verb and resource: 'Find where a string appears in the code of the repositories connected to a project.' It also specifies the output format (file, line number, surrounding lines), which clearly distinguishes it from sibling tools like search_issues and search_wiki that target different resources.

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?

The description provides a clear scope (search code in project repositories) and a constraint (only repos opened to agents), but it does not explicitly mention alternatives such as search_issues or search_wiki, nor does it say when not to use this tool. The use-case is implied rather than directly contrasted with siblings.

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