MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / ValidateInput

Method ValidateInput

tools/builtin.go:681–697  ·  view source on GitHub ↗
(execCtx ExecutionContext, input any)

Source from the content-addressed store, hash-verified

679}
680
681func (t *GlobMatchTool) ValidateInput(execCtx ExecutionContext, input any) (bool, string) {
682 in := deref[GlobMatchInput](input)
683 if in.Path == "" {
684 in.Path = "."
685 }
686 searchDir := resolveToolPath(execCtx, in.Path)
687 if isBroadSearchRoot(searchDir) {
688 return false, "Cannot glob from a filesystem root or home directory directly. Specify a more specific path within the workspace."
689 }
690 if ok, msg := checkAllowedReadRoots(searchDir, execCtx["allowed_read_roots"]); !ok {
691 return false, msg
692 }
693 if _, err := os.Stat(searchDir); err != nil {
694 return false, fmt.Sprintf("Directory not found: %s", in.Path)
695 }
696 return true, ""
697}
698
699func (t *GlobMatchTool) Execute(_ context.Context, execCtx ExecutionContext, input any) (string, error) {
700 in := deref[GlobMatchInput](input)

Callers

nothing calls this directly

Calls 3

resolveToolPathFunction · 0.85
isBroadSearchRootFunction · 0.85
checkAllowedReadRootsFunction · 0.85

Tested by

no test coverage detected