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

Function writeFileTool

src/pi-tools.ts:80–88  ·  view source on GitHub ↗
(input: WriteToolInput, context: ToolContext)

Source from the content-addressed store, hash-verified

78}
79
80export async function writeFileTool(input: WriteToolInput, context: ToolContext): Promise<ToolResponse> {
81 const path = resolveAllowedPath(input.path, context.cwd, [context.root]);
82 const tool = createWriteTool(context.cwd);
83
84 return runTool((params) => tool.execute("write_file", params), {
85 path,
86 content: input.content,
87 }, context);
88}
89
90export async function editFileTool(input: EditToolInput, context: ToolContext): Promise<ToolResponse<EditToolDetails>> {
91 const 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