Skip to content

Commit 716b7e0

Browse files
committed
Add trailing dash when returning subdirectories
1 parent 17079ab commit 716b7e0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/seclab_taskflows/mcp_servers/local_file_viewer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ def _list_files(database_path, root_dir = None, recursive=True):
8080
if not recursive:
8181
dirname = remove_root_dir(entry.filename)
8282
if Path(dirname).parent == Path(root_dir):
83-
results.append(dirname)
83+
results.append(dirname + '/')
8484
continue
8585
filename = remove_root_dir(entry.filename)
8686
if root_dir and not is_subdirectory(root_dir, filename):
8787
continue
8888
if not recursive and Path(filename).parent != Path(root_dir):
89-
continue
89+
continue
9090
results.append(filename)
9191
return results
9292

@@ -171,6 +171,7 @@ async def list_files_non_recursive(
171171
path: str = Field(description="The path to the directory in the repository")) -> str:
172172
"""
173173
List the files of a directory from a local GitHub repository non-recursively.
174+
Subdirectories will be listed and indicated with a trailing slash.
174175
"""
175176
source_path = Path(f"{LOCAL_GH_DIR}/{owner}/{repo}.zip")
176177
source_path = sanitize_file_path(source_path, [LOCAL_GH_DIR])

0 commit comments

Comments
 (0)