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
Copy file name to clipboardExpand all lines: mcpserver/tools.go
+182-6Lines changed: 182 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -115,9 +115,12 @@ func init() {
115
115
116
116
EnvironmentRunCmdTool,
117
117
118
-
EnvironmentFileReadTool,
119
118
EnvironmentFileListTool,
119
+
EnvironmentFileGlobTool,
120
+
EnvironmentFileGrepTool,
121
+
EnvironmentFileReadTool,
120
122
EnvironmentFileWriteTool,
123
+
EnvironmentFileEditTool,
121
124
EnvironmentFileDeleteTool,
122
125
123
126
EnvironmentAddServiceTool,
@@ -575,7 +578,7 @@ var EnvironmentFileReadTool = &Tool{
575
578
576
579
varEnvironmentFileListTool=&Tool{
577
580
Definition: mcp.NewTool("environment_file_list",
578
-
mcp.WithDescription("List the contents of a directory"),
581
+
mcp.WithDescription("List files and directories in a given path. You can optionally provide an array of glob patterns to ignore with the ignore parameter. You should generally prefer the environment_file_glob and environment_file_grep tools, if you know which directories to search."),
579
582
mcp.WithString("explanation",
580
583
mcp.Description("One sentence explanation for why this directory is being listed."),
581
584
),
@@ -591,6 +594,63 @@ var EnvironmentFileListTool = &Tool{
591
594
mcp.Description("Path of the directory to list contents of, absolute or relative to the workdir"),
592
595
mcp.Required(),
593
596
),
597
+
mcp.WithArray("ignore",
598
+
mcp.Description("List of glob patterns to ignore"),
returnmcp.NewToolResultErrorFromErr("failed to grep directory", err), nil
727
+
}
728
+
729
+
returnmcp.NewToolResultText(out), nil
730
+
},
731
+
}
732
+
733
+
varEnvironmentFileEditTool=&Tool{
734
+
Definition: mcp.NewTool("environment_file_edit",
735
+
mcp.WithDescription("Efficiently edit the contents of a file."),
736
+
mcp.WithString("explanation",
737
+
mcp.Description("One sentence explanation for why this file is being edited."),
738
+
),
739
+
mcp.WithString("environment_source",
740
+
mcp.Description("Absolute path to the source git repository for the environment."),
741
+
mcp.Required(),
742
+
),
743
+
mcp.WithString("environment_id",
744
+
mcp.Description("The ID of the environment for this command. Must call `environment_create` first."),
745
+
mcp.Required(),
746
+
),
747
+
mcp.WithString("target_file",
748
+
mcp.Description("Path of the file to edit, absolute or relative to the workdir."),
749
+
mcp.Required(),
750
+
),
751
+
mcp.WithArray("edits",
752
+
mcp.Description("Array of sed search-replace operations to perform on the contents of target_file (e.g. \"s/old/new/g\").\nUses extended regex syntax."),
0 commit comments