Code Engineering
Recursive regex search across project files — the 'grep' of the framework.
grep_searchThe 'where is this string used' verb. Pairs with glob_files for 'find files' and symbol_search / symbol_references for definitions vs usages.
READ_ONLY. Skips the standard build/VCS directories. Same `**/X → X` glob fallback as glob_files. Default 0 context lines; pass context_lines=N for surrounding lines.
When a user asks:
Where do we call ChatClient.call across the repo?
the agent calls the tool:
grep_search(pattern="ChatClient\\.call\\(", path_glob="**/*.java")and gets back: src/main/java/.../Agent.java:142: chatClient.call(prompt) src/main/java/.../Reviewer.java:88: ChatClient.call(buildPrompt(history)) ... 8 more
Real scenarios where agents put this tool to work.
Implementation lives at swarmai-tools/src/main/java/ai/intelliswarm/swarmai/tool/code/search/GrepSearchTool.java in the swarm-ai repository.