Skip to content

Add depth parameter to directory_tree function in filesystem server #1077

Closed

Description

@Qingqian-Wang

Hi,

I’d like to suggest adding a depth parameter to the directory_tree function in the filesystem server.

I’m currently building an AI agent that utilizes the MCP server. When I call directory_tree to list files in a system repository, the returned file structure is too large, making it difficult to include in prompts due to token limitations. A depth limit would help return a more concise, manageable view of the directory structure.

Thanks for considering this enhancement!

Activity

  1. Jatin6256 commented on Apr 2, 2025

    @Jatin6256

    Created a pull request for the enhancement. #1222

  2. added
    server-filesystemReference implementation for the Filesystem MCP server - src/filesystem
    on Apr 26, 2025
  3. cliffhall commented on Oct 19, 2026

    @cliffhall
    Member

    Triage: Priority Low (total 4)

    • Severity 2: directory_tree still has no depth limit, and an optional depth parameter is a reasonable usability improvement for large trees.
    • Urgency 2: wanted eventually
    • Bonuses: none

    Board: Servers V2 (#43), Status Incoming, awaiting maintainer review (no milestone yet). Part of the backlog triage in #4875.

  4. Qingqian-Wang commented on Oct 19, 2026

    @Qingqian-Wang
    Author
  5. cliffhall commented on Oct 20, 2026

    @cliffhall
    Member

    Prior work, from the PR backlog triage (#4877). These outside pull requests addressed this issue against the pre-refactor code:

    They are being closed as part of the backlog triage in #4875, since the repository now takes issues rather than outside PRs and their diffs predate the v2 refactor. They stay readable and serve as prototypes for the fix here. Thank you to their authors.

  6. added this to the v2.3.0 milestone on Oct 25, 2026
  7. self-assigned this
    on Oct 28, 2026
  8. cliffhall commented on Oct 29, 2026

    @cliffhall
    Member

    Shipped in #5388, merged into v2/main; it releases with milestone v2.3.0. Tested together with the rest of the #5269 work in the rollup #5405.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestserver-filesystemReference implementation for the Filesystem MCP server - src/filesystemv2

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions