MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / Execute

Method Execute

internal/tool/writefile.go:34–46  ·  view source on GitHub ↗
(_ context.Context, rawInput string)

Source from the content-addressed store, hash-verified

32}
33
34func (WriteFileTool) Execute(_ context.Context, rawInput string) (string, bool) {
35 var in struct {
36 Path string `json:"path"`
37 Content string `json:"content"`
38 }
39 if err := json.Unmarshal([]byte(rawInput), &in); err != nil {
40 return fmt.Sprintf("invalid tool input: %v", err), true
41 }
42 if err := os.WriteFile(in.Path, []byte(in.Content), 0644); err != nil {
43 return err.Error(), true
44 }
45 return fmt.Sprintf("wrote %d bytes to %s", len(in.Content), in.Path), false
46}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected