Skip to main content
Glama

search_code

Search a directory tree using a regular expression to find specific strings, such as permission declarations in decompiled APK files.

Instructions

Search a directory tree for a regex pattern - e.g. permission strings in decompiled output.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dirPathYesDirectory to search
patternYesA regular expression
workspaceNoWorkspace name (not id) - created automatically if it doesn't exist yet. Defaults to "default".
extensionsNo
maxResultsNoCap on results, default/max 200
caseSensitiveNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

A3.7/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It correctly communicates a read-only search operation over a directory tree, but it does not disclose whether results are file paths, line matches, or capped, and it does not mention the side effect that specifying a new workspace creates it automatically. This is a meaningful gap, though the core behavior is clear.

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?

One sentence with no filler: the verb and resource are front-loaded, the matching criterion is explicit, and the example earns its place by grounding the abstract regex search in a concrete scenario. Every word contributes.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with six parameters, no annotations, and no output schema, the description is lean but minimally sufficient for basic invocation using defaults. It does not explain return value shape or the workspace-creation side effect, and it leaves optional behavior like case sensitivity and extensions to the schema. The description is adequate but not complete.

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 67%, with descriptions for dirPath, pattern, workspace, and maxResults. The description reinforces that pattern is a regular expression and gives a concrete example of what to search for, but it adds no meaning for the undocumented extensions and caseSensitive parameters. Those are conventional enough that the gap is moderate rather than severe.

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?

States a specific action ('Search'), a concrete scope ('a directory tree'), and a precise criterion ('regex pattern'), with a relevant example ('permission strings in decompiled output'). This clearly distinguishes it from sibling tools like list_files or read_file, which do not search contents, and from scan_secrets, which targets a narrower class of patterns.

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 example ('e.g. permission strings in decompiled output') implies a common use case, giving some context for when to use the tool. However, there is no explicit when-to-use statement, no mention of what it should not be used for, and no comparison with alternatives such as scan_secrets or read_file.

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