You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use rust_mcp_sdk::schema::{schema_utils::CallToolError,CallToolResult};
5
3
use serde_json::json;
6
4
5
+
usecrate::error::ServiceError;
7
6
usecrate::fs_service::FileSystemService;
8
7
9
8
#[mcp_tool(
10
9
name = "directory_tree",
11
10
description = concat!("Get a recursive tree view of files and directories as a JSON structure. ",
12
11
"Each entry includes 'name', 'type' (file/directory), and 'children' for directories. ",
13
12
"Files have no children array, while directories always have a children array (which may be empty). ",
13
+
"If the 'max_depth' parameter is provided, the traversal will be limited to the specified depth. ",
14
+
"As a result, the returned directory structure may be incomplete or provide a skewed representation of the full directory tree, since deeper-level files and subdirectories beyond the specified depth will be excluded. ",
14
15
"The output is formatted with 2-space indentation for readability. Only works within allowed directories."),
15
16
destructive_hint = false,
16
17
idempotent_hint = false,
@@ -21,28 +22,31 @@ use crate::fs_service::FileSystemService;
21
22
pubstructDirectoryTreeTool{
22
23
/// The root path of the directory tree to generate.
0 commit comments