MCPcopy Index your code
hub / github.com/Waishnav/devspace / editFileTool

Function editFileTool

src/pi-tools.ts:90–98  ·  view source on GitHub ↗
(input: EditToolInput, context: ToolContext)

Source from the content-addressed store, hash-verified

88}
89
90export async function editFileTool(input: EditToolInput, context: ToolContext): Promise<ToolResponse<EditToolDetails>> {
91 const path = resolveAllowedPath(input.path, context.cwd, [context.root]);
92 const tool = createEditTool(context.cwd);
93
94 return runTool((params) => tool.execute("edit_file", params), {
95 path,
96 edits: input.edits,
97 }, context);
98}
99
100export async function grepFilesTool(input: GrepToolInput, context: ToolContext): Promise<ToolResponse> {
101 if (input.path) resolveAllowedPath(input.path, context.cwd, [context.root]);

Callers 1

createMcpServerFunction · 0.85

Calls 2

resolveAllowedPathFunction · 0.85
runToolFunction · 0.85

Tested by

no test coverage detected