MCPcopy Create free account
hub / github.com/bcefghj/miniClaudeCode / execute

Method execute

miniclaudecode/tools/grep_tool.py:40–47  ·  view source on GitHub ↗
(self, params: dict[str, Any])

Source from the content-addressed store, hash-verified

38 }
39
40 def execute(self, params: dict[str, Any]) -> ToolResult:
41 pattern = params["pattern"]
42 search_path = Path(params.get("path", ".")).expanduser().resolve()
43 include = params.get("include")
44
45 if shutil.which("rg"):
46 return self._rg_search(pattern, search_path, include)
47 return self._python_search(pattern, search_path, include)
48
49 def _rg_search(self, pattern: str, path: Path, include: str | None) -> ToolResult:
50 cmd = ["rg", "--no-heading", "--line-number", "--max-count", str(MAX_MATCHES), pattern, str(path)]

Callers

nothing calls this directly

Calls 3

_rg_searchMethod · 0.95
_python_searchMethod · 0.95
getMethod · 0.80

Tested by

no test coverage detected