Search files
search_files
SearchFilesTool — grep-like search across project files.
Registered as search_files via the axm.tools entry point.
SearchFilesTool
Grep-like search across project files.
Searches for literal strings or regex patterns across files within a
sandboxed project root. Supports glob-based file filtering.
Registered as search_files via axm.tools entry point.
Source code in packages/axm-edit/src/axm_edit/tools/search_files.py
| Python | |
|---|---|
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | |
name
property
Tool name used for MCP registration.
execute(*, path='.', pattern=None, is_regex=False, include=None, **kwargs)
Search for a pattern across project files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Project root directory (default "."). |
'.'
|
pattern
|
str | None
|
Search string or regex (required). |
None
|
is_regex
|
bool
|
Treat pattern as regex (default False). |
False
|
include
|
list[str] | None
|
Glob patterns to filter files (e.g. ["*.py"]). |
None
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
ToolResult with matches list (file, line, content), |
ToolResult
|
count, and truncated flag. |
Source code in packages/axm-edit/src/axm_edit/tools/search_files.py
render_text(*, matches, count, truncated)
Render a compact, ripgrep-style LLM-facing view of the matches.
Matches are grouped under their file path; each line is rendered as
{line}: {content}. The header carries the total match count, the
number of distinct files, and an explicit TRUNCATED flag when the
result cap was reached. Every match (file, line, content) and the
truncation signal are preserved verbatim, so no information is lost
relative to data.