Workspace: Grep
Agent Workspace
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
Agent ID (UUID)
Request Body
Regular expression to search for.
Directory or file path to search, relative to the workspace root.
Optional filename glob to include (e.g.
*.py).Number of context lines to include before and after each match.
Response
Result status (e.g.,
ok).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 <= 20
