Skip to main content
Glama

search_code

Find patterns in code files using search queries or regex within specified directories and file types.

Instructions

Search for patterns in code

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query or regex
pathYesDirectory to search in
file_patternNoFile pattern (e.g., *.py, *.js)
regexNoUse regex search

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.5/5.0
Behavior2/5

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

No annotations provided; the description carries the burden but only states 'Search for patterns in code'. It does not disclose traits like read-only behavior, recursion depth, or performance impact.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise (one sentence), which is appropriate for a simple tool, but it could include more context without being verbose.

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?

No output schema and the description does not mention return values (e.g., matched lines or file paths). The tool is incomplete for an agent that needs to know what to expect.

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 baseline is 3. The description does not add meaning beyond the schema, but the schema itself adequately describes the parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the verb 'search' and resource 'patterns in code', which is clear but vague. It does not differentiate from sibling tools like 'find_and_replace' or 'analyze_code' that also deal with code patterns.

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

Usage Guidelines2/5

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

No guidance on when to use this tool vs alternatives. The description lacks context about when it is appropriate to use search_code versus other search or analysis tools.

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