Repository navigation
Description
Problem
The built-in grep tool searches case-sensitively by default. When a user asks the agent to find an error message or a term whose capitalization is unknown, the agent must know to add Go's inline (?i) regex flag or try several searches. That workaround already works, but case-insensitive search is not discoverable in the tool schema.
Proposed improvement
Add an optional boolean ignore_case argument to grep, described in the tool schema. Keep the existing behavior when the argument is omitted or false, including support for inline regex flags.
For example, given a file containing Error: connection failed, ERROR: timeout, and error: retrying, this call should return all three matching lines:
{"pattern":"error", "path":".", "include":"*.log", "ignore_case":true}This is a small convenience feature for searches in logs, documentation, and unfamiliar repositories.
Acceptance criteria
- The
greptool schema exposesignore_caseas an optional boolean and explains its default. - With
ignore_case: true, a pattern such aserrormatcheserror,Error, andERRORin both single-file and recursive searches. - Omitted, false, or null values preserve today's regex behavior, including explicit inline flags such as
(?i); invalid non-boolean values produce an actionable tool error, consistent withreplace_all. - Case folding applies to matching file contents only. The
includeglob, returned paths, line numbers, and original line text retain their current behavior. - Invalid regexes still report an error; existing binary/large-file exclusions and match limits remain intact.
- Tests cover the default and enabled modes, interaction with
include, argument validation through the executor, and the optional boolean schema property.go test ./...passes. - Add a brief README note with an example of case-insensitive search.
Implementation pointers
The change should fit within internal/tools/grep.go, the argument/schema/dispatch handling in internal/tools/tools.go, the existing grep tests in internal/tools/tools_test.go, and the README. Reuse the existing boolArg convention. No new dependency or CLI flag is needed.
Activity