mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-17 23:54:02 +02:00
feat(directory_tree): add excludePatterns support & documentation (#623)
- Update documentation with directory_tree declaration - Add excludePatterns parameter to DirectoryTreeArgsSchema - Implement pattern exclusion in buildTree function using minimatch - Pass excludePatterns through recursive calls - Support both simple and glob patterns for exclusion - Maintain consistent behavior with search_files implementation * Add tests and fix implementation --------- Co-authored-by: Ola Hungerford <olahungerford@gmail.com> Co-authored-by: Adam Jones <adamj+git@anthropic.com> Co-authored-by: Adam Jones <adamj@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
46d0b1f926
commit
d381cf1ffd
@@ -153,6 +153,19 @@ The server's directory access control follows this flow:
|
||||
- Case-insensitive matching
|
||||
- Returns full paths to matches
|
||||
|
||||
- **directory_tree**
|
||||
- Get recursive JSON tree structure of directory contents
|
||||
- Inputs:
|
||||
- `path` (string): Starting directory
|
||||
- `excludePatterns` (string[]): Exclude any patterns. Glob formats are supported.
|
||||
- Returns:
|
||||
- JSON array where each entry contains:
|
||||
- `name` (string): File/directory name
|
||||
- `type` ('file'|'directory'): Entry type
|
||||
- `children` (array): Present only for directories
|
||||
- Empty array for empty directories
|
||||
- Omitted for files
|
||||
|
||||
- **get_file_info**
|
||||
- Get detailed file/directory metadata
|
||||
- Input: `path` (string)
|
||||
|
||||
Reference in New Issue
Block a user