Skip to content

Commit ee984a7

Browse files
committed
docs + remove search-files tool
1 parent 6e9480a commit ee984a7

File tree

3 files changed

+1
-84
lines changed

3 files changed

+1
-84
lines changed

docs/features.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ Some native tools like `filesystem` have MCP alternatives, but ECA having them b
1919

2020
Provides access to filesystem under workspace root, listing and reading files and directories a subset of [official MCP filesystem](https://mcpserverhub.com/servers/filesystem), important for agentic operations, without the need to support NPM or other tools.
2121

22+
- `eca_directory_tree`: list a directory as a tree (can be recursive).
2223
- `eca_read_file`: read a file content.
2324
- `eca_write_file`: write content to a new file.
2425
- `eca_edit_file`: replace lines of a file with a new content.
2526
- `eca_move_file`: move/rename a file.
26-
- `eca_list_directory`: list a directory.
27-
- `eca_search_files`: search in a path for files matching a pattern.
2827
- `eca_grep`: ripgrep/grep for paths with specified content.
2928

3029
#### Shell

src/eca/features/tools/filesystem.clj

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,6 @@
5454
(spit path content)
5555
(tools.util/single-text-content (format "Successfully wrote to %s" path)))))
5656

57-
(defn ^:private search-files [arguments {:keys [db]}]
58-
(or (tools.util/invalid-arguments arguments (concat (path-validations db)
59-
[["pattern" #(not (string/blank? %)) "Invalid glob pattern '$pattern'"]]))
60-
(let [pattern (get arguments "pattern")
61-
pattern (if (string/includes? pattern "*")
62-
pattern
63-
(format "**%s**" pattern))
64-
paths (reduce
65-
(fn [paths {:keys [uri]}]
66-
(concat paths (fs/glob (shared/uri->filename uri)
67-
pattern)))
68-
[]
69-
(:workspace-folders db))]
70-
(if (seq paths)
71-
(tools.util/single-text-content (string/join "\n" paths))
72-
(tools.util/single-text-content "No matches found" :error)))))
73-
7457
(defn ^:private run-ripgrep [path pattern include]
7558
(let [cmd (cond-> ["rg" "--files-with-matches" "--no-heading"]
7659
include (concat ["--glob" include])
@@ -264,20 +247,6 @@
264247
:description "The new absolute file path to move to."}}
265248
:required ["source" "destination"]}
266249
:handler #'move-file}
267-
"eca_search_files"
268-
{:description (str "Recursively search for files and directories matching a pattern. "
269-
"Searches through all subdirectories from the starting path. The search "
270-
"is case-insensitive and matches partial names following java's FileSystem#getPathMatcher. Returns full paths to all "
271-
"matching items. Great for finding files when you don't know their exact location. "
272-
"**Only works within the directories: $workspaceRoots.**")
273-
:parameters {:type "object"
274-
:properties {"path" {:type "string"
275-
:description "The absolute path to start searching files from there."}
276-
"pattern" {:type "string"
277-
:description (str "Glob pattern following java FileSystem#getPathMatcher matching files or directory names."
278-
"Use '**' to match search in multiple levels like '**.txt'")}}
279-
:required ["path" "pattern"]}
280-
:handler #'search-files}
281250
"eca_grep"
282251
{:description (str "Fast content search tool that works with any codebase size. "
283252
"Finds the paths to files that have matching contents using regular expressions. "

test/eca/features/tools/filesystem_test.clj

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -126,57 +126,6 @@
126126
{"path" (h/file-path "/foo/qux/new_file.clj")}
127127
{:db {:workspace-folders [{:uri (h/file-uri "file:///foo/bar") :name "bar"}]}}))))))
128128

129-
(deftest search-files-test
130-
(testing "invalid pattern"
131-
(is (match?
132-
{:error true
133-
:contents [{:type :text
134-
:text "Invalid glob pattern ' '"}]}
135-
(with-redefs [fs/exists? (constantly true)]
136-
((get-in f.tools.filesystem/definitions ["eca_search_files" :handler])
137-
{"path" (h/file-path "/project/foo")
138-
"pattern" " "}
139-
{:db {:workspace-folders [{:uri (h/file-uri "file:///project/foo") :name "foo"}]}})))))
140-
(testing "no matches"
141-
(is (match?
142-
{:error true
143-
:contents [{:type :text
144-
:text "No matches found"}]}
145-
(with-redefs [fs/exists? (constantly true)
146-
fs/glob (constantly [])]
147-
((get-in f.tools.filesystem/definitions ["eca_search_files" :handler])
148-
{"path" (h/file-path "/project/foo")
149-
"pattern" "foo"}
150-
{:db {:workspace-folders [{:uri (h/file-uri "file:///project/foo") :name "foo"}]}})))))
151-
(testing "matches with wildcard"
152-
(is (match?
153-
{:error false
154-
:contents [{:type :text
155-
:text (str (h/file-path "/project/foo/bar/baz.txt") "\n"
156-
(h/file-path "/project/foo/qux.txt") "\n"
157-
(h/file-path "/project/foo/qux.clj"))}]}
158-
(with-redefs [fs/exists? (constantly true)
159-
fs/glob (constantly [(fs/path (h/file-path "/project/foo/bar/baz.txt"))
160-
(fs/path (h/file-path "/project/foo/qux.txt"))
161-
(fs/path (h/file-path "/project/foo/qux.clj"))])]
162-
((get-in f.tools.filesystem/definitions ["eca_search_files" :handler])
163-
{"path" (h/file-path "/project/foo")
164-
"pattern" "**"}
165-
{:db {:workspace-folders [{:uri (h/file-uri "file:///project/foo") :name "foo"}]}})))))
166-
(testing "matches without wildcard"
167-
(is (match?
168-
{:error false
169-
:contents [{:type :text
170-
:text (str (h/file-path "/project/foo/bar/baz.txt") "\n"
171-
(h/file-path "/project/foo/qux.txt"))}]}
172-
(with-redefs [fs/exists? (constantly true)
173-
fs/glob (constantly [(fs/path (h/file-path "/project/foo/bar/baz.txt"))
174-
(fs/path (h/file-path "/project/foo/qux.txt"))])]
175-
((get-in f.tools.filesystem/definitions ["eca_search_files" :handler])
176-
{"path" (h/file-path "/project/foo")
177-
"pattern" ".txt"}
178-
{:db {:workspace-folders [{:uri (h/file-uri "file:///project/foo") :name "foo"}]}}))))))
179-
180129
(deftest grep-test
181130
(testing "invalid pattern"
182131
(is (match?

0 commit comments

Comments
 (0)