search_ops
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
| Name | Required | Description | Default |
|---|---|---|---|
| fix | No | ||
| path | No | ||
| path2 | No | ||
| encoding | No | utf-8 | |
| end_time | No | ||
| min_size | No | ||
| max_lines | No | ||
| operation | No | ||
| recursive | No | ||
| early_exit | No | ||
| log_levels | No | ||
| start_time | No | ||
| max_matches | No | ||
| max_results | No | ||
| min_size_mb | No | ||
| context_lines | No | ||
| case_sensitive | No | ||
| hash_algorithm | No | md5 | |
| include_hidden | No | ||
| max_duplicates | No | ||
| search_pattern | No | ||
| exclude_log_levels | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||