Workspace: Grep
Agent Workspace
Grep
Search for a regex pattern across files in the agent’s workspace
POST
Workspace: Grep
Search for a regex pattern across files in the per-agent workspace, with optional file-type filtering and surrounding context lines.
Path Parameters
string
required
Agent ID (UUID)
Request Body
string
required
Regular expression to search for.
string
Directory or file path to search, relative to the workspace root.
string
Optional filename glob to include (e.g.
*.py).integer
default:0
Number of context lines to include before and after each match.
Response
string
Result status (e.g.,
ok).array
Array of match objects, each including the file path, matching line, and surrounding context.
Example Request
Notes
patternis a regex. Escape regex metacharacters if you want to match them literally.- Narrow the search with
pathandincludefor faster results on large workspaces.
See Also
Authorizations
API Key for authentication
Path Parameters
Body
application/json
Regex pattern to search for (Extended Regular Expressions).
Example:
"def main"
Directory or file path to search in, relative to workspace root. Directories are searched recursively.
Example:
"src"
Glob pattern to filter which files to search (e.g. '*.py' to only search Python files).
Example:
"*.py"
Number of lines of context to show before and after each match.
Required range:
0 <= x <= 20Response
Successful Response

