Skip to main content
Glama

search_ops

Read-onlyIdempotent

Search file contents with regex, match filenames by glob, count patterns, compare files, find duplicates or large files, extract log lines, locate TODOs and symbols, and validate JSON or configs.

Instructions

Content Analysis, Grep, and Comparison operations.

Operations: grep_file, count_pattern, search_files, extract_log_lines, compare_files, find_duplicate_files, find_large_files, find_todos, find_symbols, validate_json, analyze_project, run_linter, validate_config. find_todos, find_symbols, validate_json.

Pattern semantics (read this before picking an operation):

  • grep_file / count_pattern take a CONTENT regex searched inside file text.

  • search_files takes a FILENAME glob (fnmatch, e.g. ".py", "test_") matched against file names only — it never looks at file content. For content search across a tree, use grep_file with recursive=True.

Args: See Parameters block.

Return Format

{"success": bool, "action": str, "message": str, "result": {...}}

  • grep_file: {"matches": [{"file": str, "line": int, "text": str}], "count": int}

  • count_pattern: {"count": int}

  • compare_files: {"diff": str, "lines": int}

Examples

search_ops(operation="grep_file", path="D:/Dev/repos", search_pattern="assfix", recursive=True) search_ops(operation="find_large_files", path="D:/data", min_size_mb=500) search_ops(operation="compare_files", path="a.txt", path2="b.txt")

Input Schema

NameRequiredDescriptionDefault
fixNo
pathNo
path2No
encodingNoutf-8
end_timeNo
min_sizeNo
max_linesNo
operationNo
recursiveNo
early_exitNo
log_levelsNo
start_timeNo
max_matchesNo
max_resultsNo
min_size_mbNo
context_linesNo
case_sensitiveNo
hash_algorithmNomd5
include_hiddenNo
max_duplicatesNo
search_patternNo
exclude_log_levelsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.1.0

TDQS

B3/5.0
Behavior3/5

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

Annotations already declare readOnly/idempotent/non-destructive and closed-world, so the safety profile is covered. The description adds valuable behavior ('search_files ... never looks at file content') and partial return shapes. But it is silent on risky-looking surface like fix=true, run_linter, and early_exit, leaving real behavioral questions unanswered against a declared read-only contract.

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?

Structure is good: operations list first, then the critical pattern semantics, then return format and examples. But it is marred by duplicated text ('find_todos, find_symbols, validate_json.' appears twice) and by return-format detail for only 3 of 13 operations while examples carry more weight than prose should need to.

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 13-operation, 22-parameter dispatcher with zero schema description coverage, the description is far short of what an agent needs to invoke operations correctly — there is no per-operation parameter mapping and no mention of output for ten operations. An output schema exists, so return-value explanation is largely unnecessary, yet the agent still cannot tell which parameters apply to which operation.

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% across 22 parameters, and the description dismisses them with 'Args: See Parameters block,' which supplies no meaning. Only search_pattern, path, and min_size_mb get any explanation (via the semantics note and an example); the remaining parameters, including fix, hash_algorithm, log_levels, start_time/end_time, and max_duplicates, are undocumented anywhere.

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 family and resource ('Content Analysis, Grep, and Comparison operations') and enumerates all 13 supported operations, so an agent knows the capability surface. It does not, however, distinguish itself from siblings like file_ops or dir_ops, so the boundary with those tools stays ambiguous.

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 'Pattern semantics' section gives a real when-to-use rule between two operations (content regex for grep_file/count_pattern vs filename glob for search_files, plus the recursive=True escape hatch). There is no guidance for when to pick this tool over file_ops/dir_ops, no exclusions, and no guidance for the other eleven operations.

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