Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/filesystem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ The server's directory access control follows this flow:
- Fails if destination exists

- **search_files**
- Recursively search for files/directories that match or do not match patterns
- Recursively search for files/directories by name or path, not file contents
- Inputs:
- `path` (string): Starting directory
- `pattern` (string): Search pattern
Expand Down
8 changes: 8 additions & 0 deletions src/filesystem/__tests__/structured-content.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ describe('structuredContent schema compliance', () => {
});

describe('search_files (control - already working)', () => {
it('should describe name/path matching rather than content search', async () => {
const result = await client.listTools();
const searchFiles = result.tools.find((tool) => tool.name === 'search_files');

expect(searchFiles?.description).toContain('by name or path');
expect(searchFiles?.description).toContain('not file contents');
});

it('should return structuredContent.content as a string', async () => {
const result = await client.callTool({
name: 'search_files',
Expand Down
4 changes: 2 additions & 2 deletions src/filesystem/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,8 @@ server.registerTool(
{
title: "Search Files",
description:
"Recursively search for files and directories matching a pattern. " +
"The patterns should be glob-style patterns that match paths relative to the working directory. " +
"Recursively search for files and directories by name or path, not file contents. " +
"The patterns should be glob-style patterns that match paths relative to the search directory. " +
"Use pattern like '*.ext' to match files in current directory, and '**/*.ext' to match files in all subdirectories. " +
"Returns full paths to all matching items. Great for finding files when you don't know their exact location. " +
"Only searches within allowed directories.",
Expand Down
Loading