Skip to content

feat: improve tools descriptions #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 1, 2025
Merged
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
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 13 additions & 49 deletions docs/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
<td>
<code><b>create_directory</b></code>
</td>
<td>Create a new directory or ensure a directory exists. Can create multiple
nested directories in one operation. If the directory already exists,
this operation will succeed silently. Perfect for setting up directory
structures for projects or ensuring required paths exist. Only works within allowed directories.</td>
<td>Create a new directory or ensure a directory exists. Can create multiple nested directories in one operation. If the directory already exists, this operation will succeed silently. Perfect for setting up directory structures for projects or ensuring required paths exist. Only works within allowed directories.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>path</code> : string<br /></li>
Expand All @@ -36,10 +33,7 @@ structures for projects or ensuring required paths exist. Only works within allo
<td>
<code><b>directory_tree</b></code>
</td>
<td>Get a recursive tree view of files and directories as a JSON structure.
Each entry includes <code>name</code>, <code>type</code> (file/directory), and <code>children</code> for directories.
Files have no children array, while directories always have a children array (which may be empty).
The output is formatted with 2-space indentation for readability. Only works within allowed directories.</td>
<td>Get a recursive tree view of files and directories as a JSON structure. Each entry includes <code>name</code>, <code>type</code> (file/directory), and <code>children</code> for directories. Files have no children array, while directories always have a children array (which may be empty). The output is formatted with 2-space indentation for readability. Only works within allowed directories.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>path</code> : string<br /></li>
Expand All @@ -51,9 +45,7 @@ The output is formatted with 2-space indentation for readability. Only works wit
<td>
<code><b>edit_file</b></code>
</td>
<td>Make line-based edits to a text file. Each edit replaces exact line sequences
with new content. Returns a git-style diff showing the changes made.
Only works within allowed directories.</td>
<td>Make line-based edits to a text file. Each edit replaces exact line sequences with new content. Returns a git-style diff showing the changes made. Only works within allowed directories.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>dryRun</code> : boolean<br /></li>
Expand All @@ -67,10 +59,7 @@ Only works within allowed directories.</td>
<td>
<code><b>get_file_info</b></code>
</td>
<td>Retrieve detailed metadata about a file or directory. Returns comprehensive
information including size, creation time, last modified time, permissions,
and type. This tool is perfect for understanding file characteristics
without reading the actual content. Only works within allowed directories.</td>
<td>Retrieve detailed metadata about a file or directory. Returns comprehensive information including size, creation time, last modified time, permissions, and type. This tool is perfect for understanding file characteristics without reading the actual content. Only works within allowed directories.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>path</code> : string<br /></li>
Expand All @@ -82,9 +71,7 @@ without reading the actual content. Only works within allowed directories.</td>
<td>
<code><b>list_allowed_directories</b></code>
</td>
<td>Returns a list of directories that the server has permission to access.
Subdirectories within these allowed directories are also accessible.
Use this to identify which directories and their nested paths are available before attempting to access files.</td>
<td>Returns a list of directories that the server has permission to access Subdirectories within these allowed directories are also accessible. Use this to identify which directories and their nested paths are available before attempting to access files.</td>
<td>
<ul>
</ul>
Expand All @@ -95,10 +82,7 @@ without reading the actual content. Only works within allowed directories.</td>
<td>
<code><b>list_directory</b></code>
</td>
<td>Get a detailed listing of all files and directories in a specified path.
Results clearly distinguish between files and directories with <code>FILE</code> and <code>DIR</code>
prefixes. This tool is essential for understanding directory structure and
finding specific files within a directory. Only works within allowed directories.</td>
<td>Get a detailed listing of all files and directories in a specified path. Results clearly distinguish between files and directories with <code>FILE</code> and <code>DIR</code> prefixes. This tool is essential for understanding directory structure and finding specific files within a directory. Only works within allowed directories.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>path</code> : string<br /></li>
Expand All @@ -110,10 +94,7 @@ finding specific files within a directory. Only works within allowed directories
<td>
<code><b>move_file</b></code>
</td>
<td>Move or rename files and directories. Can move files between directories
and rename them in a single operation. If the destination exists, the
operation will fail. Works across different directories and can be used
for simple renaming within the same directory. Both source and destination must be within allowed directories.</td>
<td>Move or rename files and directories. Can move files between directories and rename them in a single operation. If the destination exists, the operation will fail. Works across different directories and can be used for simple renaming within the same directory. Both source and destination must be within allowed directories.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>destination</code> : string<br /></li>
Expand All @@ -138,11 +119,7 @@ for simple renaming within the same directory. Both source and destination must
<td>
<code><b>read_multiple_files</b></code>
</td>
<td>Read the contents of multiple files simultaneously. This is more
efficient than reading files one by one when you need to analyze
or compare multiple files. Each file's content is returned with its
path as a reference. Failed reads for individual files won't stop
the entire operation. Only works within allowed directories.</td>
<td>Read the contents of multiple files simultaneously. This is more efficient than reading files one by one when you need to analyze or compare multiple files. Each file's content is returned with its path as a reference. Failed reads for individual files won't stop the entire operation. Only works within allowed directories.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>paths</code> : string [ ]<br /></li>
Expand All @@ -154,11 +131,7 @@ the entire operation. Only works within allowed directories.</td>
<td>
<code><b>search_files</b></code>
</td>
<td>Recursively search for files and directories matching a pattern.
Searches through all subdirectories from the starting path. The search
is case-insensitive and matches partial names. Returns full paths to all
matching items. Great for finding files when you don't know their exact location.
Only searches within allowed directories.</td>
<td>Recursively search for files and directories matching a pattern. Searches through all subdirectories from the starting path. The search is case-insensitive and matches partial names. Returns full paths to all matching items. Great for finding files when you don't know their exact location. Only searches within allowed directories.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>excludePatterns</code> : string [ ]<br /></li>
Expand All @@ -172,10 +145,7 @@ Only searches within allowed directories.</td>
<td>
<code><b>unzip_file</b></code>
</td>
<td>Extracts the contents of a ZIP archive to a specified target directory.
It takes a source ZIP file path and a target extraction directory.
The tool decompresses all files and directories stored in the ZIP, recreating their structure in the target location.
Both the source ZIP file and the target directory should reside within allowed directories.</td>
<td>Extracts the contents of a ZIP archive to a specified target directory.<br/>It takes a source ZIP file path and a target extraction directory.<br/>The tool decompresses all files and directories stored in the ZIP, recreating their structure in the target location. <br/>Both the source ZIP file and the target directory should reside within allowed directories.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>target_path</code> : string<br /></li>
Expand All @@ -188,9 +158,7 @@ Both the source ZIP file and the target directory should reside within allowed d
<td>
<code><b>write_file</b></code>
</td>
<td>Create a new file or completely overwrite an existing file with new content.
Use with caution as it will overwrite existing files without warning.
Handles text content with proper encoding. Only works within allowed directories.</td>
<td>Create a new file or completely overwrite an existing file with new content. Use with caution as it will overwrite existing files without warning. Handles text content with proper encoding. Only works within allowed directories.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>content</code> : string<br /></li>
Expand All @@ -203,9 +171,7 @@ Handles text content with proper encoding. Only works within allowed directories
<td>
<code><b>zip_directory</b></code>
</td>
<td>Creates a ZIP archive by compressing a directory , including files and subdirectories matching a specified glob pattern.
It takes a path to the folder and a glob pattern to identify files to compress and a target path for the resulting ZIP file.
Both the source directory and the target ZIP file should reside within allowed directories.</td>
<td>Creates a ZIP archive by compressing a directory , including files and subdirectories matching a specified glob pattern.<br/>It takes a path to the folder and a glob pattern to identify files to compress and a target path for the resulting ZIP file.<br/>Both the source directory and the target ZIP file should reside within allowed directories.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>input_directory</code> : string<br /></li>
Expand All @@ -219,9 +185,7 @@ Both the source directory and the target ZIP file should reside within allowed d
<td>
<code><b>zip_files</b></code>
</td>
<td>Creates a ZIP archive by compressing files.
It takes a list of files to compress and a target path for the resulting ZIP file.
Both the source files and the target ZIP file should reside within allowed directories.</td>
<td>Creates a ZIP archive by compressing files. It takes a list of files to compress and a target path for the resulting ZIP file. Both the source files and the target ZIP file should reside within allowed directories.</td>
<td>
<ul>
<li style="white-space: nowrap;"> <code>input_files</code> : string [ ]<br /></li>
Expand Down
9 changes: 5 additions & 4 deletions src/tools/create_directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ use crate::fs_service::FileSystemService;

#[mcp_tool(
name = "create_directory",
description = "Create a new directory or ensure a directory exists. Can create multiple
nested directories in one operation. If the directory already exists,
this operation will succeed silently. Perfect for setting up directory
structures for projects or ensuring required paths exist. Only works within allowed directories."
description = concat!("Create a new directory or ensure a directory exists. ",
"Can create multiple nested directories in one operation. ",
"If the directory already exists, this operation will succeed silently. ",
"Perfect for setting up directory structures for projects or ensuring required paths exist. ",
"Only works within allowed directories.")
)]
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, JsonSchema)]
pub struct CreateDirectoryTool {
Expand Down
8 changes: 4 additions & 4 deletions src/tools/directory_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ use crate::fs_service::FileSystemService;

#[mcp_tool(
name = "directory_tree",
description = "Get a recursive tree view of files and directories as a JSON structure.
Each entry includes 'name', 'type' (file/directory), and 'children' for directories.
Files have no children array, while directories always have a children array (which may be empty).
The output is formatted with 2-space indentation for readability. Only works within allowed directories."
description = concat!("Get a recursive tree view of files and directories as a JSON structure. ",
"Each entry includes 'name', 'type' (file/directory), and 'children' for directories. ",
"Files have no children array, while directories always have a children array (which may be empty). ",
"The output is formatted with 2-space indentation for readability. Only works within allowed directories.")
)]
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, JsonSchema)]
pub struct DirectoryTreeTool {
Expand Down
7 changes: 4 additions & 3 deletions src/tools/edit_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ pub struct EditOperation {

#[mcp_tool(
name = "edit_file",
description = "Make line-based edits to a text file. Each edit replaces exact line sequences
with new content. Returns a git-style diff showing the changes made.
Only works within allowed directories."
description = concat!("Make line-based edits to a text file. ",
"Each edit replaces exact line sequences with new content. ",
"Returns a git-style diff showing the changes made. ",
"Only works within allowed directories.")
)]
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, JsonSchema)]
pub struct EditFileTool {
Expand Down
9 changes: 5 additions & 4 deletions src/tools/get_file_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ use crate::fs_service::FileSystemService;

#[mcp_tool(
name = "get_file_info",
description = "Retrieve detailed metadata about a file or directory. Returns comprehensive
information including size, creation time, last modified time, permissions,
and type. This tool is perfect for understanding file characteristics
without reading the actual content. Only works within allowed directories."
description = concat!("Retrieve detailed metadata about a file or directory. ",
"Returns comprehensive information including size, creation time, ",
"last modified time, permissions, and type. ",
"This tool is perfect for understanding file characteristics without ",
"reading the actual content. Only works within allowed directories.")
)]
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, JsonSchema)]
pub struct GetFileInfoTool {
Expand Down
7 changes: 4 additions & 3 deletions src/tools/list_allowed_directories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ use crate::fs_service::FileSystemService;

#[mcp_tool(
name = "list_allowed_directories",
description = "Returns a list of directories that the server has permission to access.
Subdirectories within these allowed directories are also accessible.
Use this to identify which directories and their nested paths are available before attempting to access files."
description = concat!("Returns a list of directories that the server has permission ",
"to access Subdirectories within these allowed directories are also accessible. ",
"Use this to identify which directories and their nested paths are available ",
"before attempting to access files.")
)]
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, JsonSchema)]
pub struct ListAllowedDirectoriesTool {}
Expand Down
8 changes: 4 additions & 4 deletions src/tools/list_directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ use crate::fs_service::FileSystemService;

#[mcp_tool(
name = "list_directory",
description = "Get a detailed listing of all files and directories in a specified path.
Results clearly distinguish between files and directories with [FILE] and [DIR]
prefixes. This tool is essential for understanding directory structure and
finding specific files within a directory. Only works within allowed directories."
description = concat!("Get a detailed listing of all files and directories in a specified path. ",
"Results clearly distinguish between files and directories with [FILE] and [DIR] ",
"prefixes. This tool is essential for understanding directory structure and ",
"finding specific files within a directory. Only works within allowed directories.")
)]
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, JsonSchema)]
pub struct ListDirectoryTool {
Expand Down
9 changes: 5 additions & 4 deletions src/tools/move_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ use crate::fs_service::FileSystemService;

#[mcp_tool(
name = "move_file",
description = "Move or rename files and directories. Can move files between directories
and rename them in a single operation. If the destination exists, the
operation will fail. Works across different directories and can be used
for simple renaming within the same directory. Both source and destination must be within allowed directories."
description = concat!("Move or rename files and directories. Can move files between directories ",
"and rename them in a single operation. If the destination exists, the ",
"operation will fail. Works across different directories and can be used ",
"for simple renaming within the same directory. ",
"Both source and destination must be within allowed directories.")
)]
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug, JsonSchema)]
pub struct MoveFileTool {
Expand Down
Loading