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

Method Execute

internal/tool/readfile.go:30–42  ·  view source on GitHub ↗
(_ context.Context, rawInput string)

Source from the content-addressed store, hash-verified

28}
29
30func (ReadFileTool) Execute(_ context.Context, rawInput string) (string, bool) {
31 var in struct {
32 Path string `json:"path"`
33 }
34 if err := json.Unmarshal([]byte(rawInput), &in); err != nil {
35 return fmt.Sprintf("invalid tool input: %v", err), true
36 }
37 data, err := os.ReadFile(in.Path)
38 if err != nil {
39 return err.Error(), true
40 }
41 return string(data), false
42}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected