Skip to main content
Glama

code.search_code

Search code in a workspace root by query, with optional glob filters and max results. Uses ripgrep when available, otherwise falls back to a built-in scanner.

Instructions

Search workspaceRoot. Uses ripgrep when available and falls back to a built-in scanner.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
globNo
queryYes
maxResultsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0-alpha.14

TDQS

B3.1/5.0
Behavior3/5

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

The description discloses a meaningful behavioral trait: it uses ripgrep when available and falls back to a built-in scanner. This is useful context beyond the schema. However, with no annotations provided, the description carries the full burden and doesn't disclose other behaviors like case sensitivity, regex support, or whether results are limited by maxResults.

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 a single concise sentence that front-loads the primary action and scope. It earns its place by adding the ripgrep fallback detail, though it could be slightly more informative about parameters.

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?

For a search tool with 3 parameters, no output schema, and no annotations, the description is too sparse. It doesn't explain what the search returns, how glob filtering works, what maxResults does, or any limitations. An agent would need to guess at the behavior of the built-in scanner and the meaning of the parameters.

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 must compensate for the undocumented parameters. It only mentions 'query' implicitly through 'Search workspaceRoot' and doesn't explain 'glob' or 'maxResults' semantics. The description adds minimal value beyond the schema's bare parameter names.

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 states a specific verb ('Search') and resource ('workspaceRoot'), which clearly identifies the tool as a code search function. It doesn't explicitly differentiate from siblings like code.read_file, but the search intent is clear enough to distinguish it from read/apply/commit operations.

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 implies usage context by mentioning the search scope (workspaceRoot) and the fallback mechanism, but it doesn't explicitly state when to use this tool versus alternatives like code.read_file or security.scan_source. No exclusions or alternative routing are provided.

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

Deploy Server

Other Tools