grep#

Build typed tools from annotations and docstrings. See the guide.

Search UTF-8 text files selected by a relative or absolute glob pattern.

Parameters#

{
  "additionalProperties": false,
  "properties": {
    "pattern": {
      "minLength": 1,
      "title": "Pattern",
      "type": "string",
      "description": "Python regular expression to search for on each line."
    },
    "file_pattern": {
      "default": "**/*",
      "minLength": 1,
      "title": "File Pattern",
      "type": "string",
      "description": "Relative or absolute glob selecting files to search."
    },
    "case_sensitive": {
      "default": true,
      "title": "Case Sensitive",
      "type": "boolean",
      "description": "Whether letter case must match exactly."
    },
    "max_results": {
      "maximum": 5000,
      "minimum": 1,
      "type": "integer",
      "default": 200,
      "description": "Maximum number of matching lines to return."
    }
  },
  "required": [
    "pattern"
  ],
  "title": "ToolInput",
  "type": "object"
}

Model-facing snippet#

grep(pattern="class\s+Agent", file_pattern="src/**/*.py", max_results=200)

Guidelines#

  • Use a narrow file_pattern to avoid scanning unrelated files.

  • Escape regular-expression characters when searching for literal text.

  • Each match is one path:line:text line; use read_file for surrounding context.

zett_agent.tools.coding.grep#

A tool is a name, an input schema, and an async callable.

Parameters:

arguments (Mapping[str, Any])

Return type:

ToolResult

Direct Python calls use await tool(arguments_mapping). The snippet above describes model-facing invocation syntax, not the Python call signature.