(execCtx ExecutionContext, input any)
| 679 | } |
| 680 | |
| 681 | func (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 | |
| 699 | func (t *GlobMatchTool) Execute(_ context.Context, execCtx ExecutionContext, input any) (string, error) { |
| 700 | in := deref[GlobMatchInput](input) |
nothing calls this directly
no test coverage detected