Skip to content

Conversation

@recursivecodes
Copy link

Description

Modify 'directory_tree' to allow exclusion of directories.

Server Details

  • Server: filesystem
  • Changes to: 'directory_tree' tool

Motivation and Context

Useful when listing project directories that contain dependencies (like 'node_modules', for example), to avoid creating an input token too large to be processed.

How Has This Been Tested?

Ran changes locally and prompted Claude 3.7 as follows:

give me a tree representation of /project/dir, ignoring node_modules

Breaking Changes

nope.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • [x ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Protocol Documentation
  • My changes follows MCP security best practices
  • [] I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

Additional context

This tool (directory_tree) is not documented in the README.md, so I did not update it.

Useful when listing project directories that contain dependencies (like 'node_modules', for example), to avoid creating an input token too large to be processed.
@olaservo olaservo added server-filesystem Reference implementation for the Filesystem MCP server - src/filesystem enhancement New feature or request labels Apr 18, 2025
@domdomegg
Copy link
Member

Thanks for your contribution! This looks like a duplicate of #623. We're tracking this there, so I'm going to close this one to keep the discussion consolidated. Feel free to add any additional context or thoughts to the original issue if you have them!

@domdomegg domdomegg closed this Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request server-filesystem Reference implementation for the Filesystem MCP server - src/filesystem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants