Skip to content

Tool Improvement: Refine search_file_content schema and description #17544

@mattKorwel

Description

@mattKorwel

Overview

Part of the tool augmentation effort to optimize tool definitions for Gemini 3.0.

Proposed Changes

Update description to emphasize its role as a FAST, optimized search powered by ripgrep and its automatic output limiting (max 20k matches).

Audit and minimize/remove "how-to" sections in tool definitions to optimize the context budget.

Context from Planning

{
  "name": "search_file_content",
  "description": "FAST, optimized search powered by `ripgrep`. PREFERRED over standard `run_shell_command(\"grep ...\")` due to better performance and automatic output limiting (max 20k matches).",
  "parametersJsonSchema": {
    "properties": {
      "pattern": { "description": "The pattern to search for. By default, treated as a Rust-flavored regular expression. Use '\\b' for precise symbol matching (e.g., '\\bMatchMe\\b').", "type": "string" },
      "dir_path": { "description": "Directory or file to search. Directories are searched recursively. Relative paths are resolved against current working directory. Defaults to current working directory ('.') if omitted.", "type": "string" },
      "include": { "description": "Glob pattern to filter files (e.g., '*.ts', 'src/**'). Recommended for large repositories to reduce noise. Defaults to all files if omitted.", "type": "string" },
      "case_sensitive": { "description": "If true, search is case-sensitive. Defaults to false (ignore case) if omitted.", "type": "boolean" },
      "fixed_strings": { "description": "If true, treats the `pattern` as a literal string instead of a regular expression. Defaults to false (basic regex) if omitted.", "type": "boolean" },
      "context": { "description": "Show this many lines of context around each match (equivalent to grep -C). Defaults to 0 if omitted.", "type": "integer" },
      "after": { "description": "Show this many lines after each match (equivalent to grep -A). Defaults to 0 if omitted.", "type": "integer" },
      "before": { "description": "Show this many lines before each match (equivalent to grep -B). Defaults to 0 if omitted.", "type": "integer" },
      "no_ignore": { "description": "If true, searches all files including those usually ignored (like in .gitignore, build/, dist/, etc). Defaults to false if omitted.", "type": "boolean" }
    },
    "required": [ "pattern" ],
    "type": "object"
  }
}

Parent: #15331

Metadata

Metadata

Assignees

Labels

area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Qualityworkstream-rollupLabel used to tag epics and features that are associated with one of the three primary workstreams🔒 maintainer only⛔ Do not contribute. Internal roadmap item.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions