@@ -54,7 +54,7 @@ func NewLsTool(permissions permission.Service, workingDir string, lsConfig confi
54 func(ctx context.Context, params LSParams, call fantasy.ToolCall) (fantasy.ToolResponse, error) {
54 func(ctx context.Context, params LSParams, call fantasy.ToolCall) (fantasy.ToolResponse, error) {
55 searchPath, err := fsext.Expand(cmp.Or(params.Path, workingDir))
55 searchPath, err := fsext.Expand(cmp.Or(params.Path, workingDir))
56 if err != nil {
56 if err != nil {
57− return fantasy.ToolResponse{}, fmt.Errorf("error expanding path: %w", err)
57+ return fantasy.NewTextErrorResponse(fmt.Sprintf("error expanding path: %v", err)), nil
60 if !filepath.IsAbs(searchPath) {
60 if !filepath.IsAbs(searchPath) {
@@ -64,12 +64,12 @@ func NewLsTool(permissions permission.Service, workingDir string, lsConfig confi
64 // Check if directory is outside working directory and request permission if needed
64 // Check if directory is outside working directory and request permission if needed
65 absWorkingDir, err := filepath.Abs(workingDir)
65 absWorkingDir, err := filepath.Abs(workingDir)
66 if err != nil {
66 if err != nil {
67− return fantasy.ToolResponse{}, fmt.Errorf("error resolving working directory: %w", err)
67+ return fantasy.NewTextErrorResponse(fmt.Sprintf("error resolving working directory: %v", err)), nil
70 absSearchPath, err := filepath.Abs(searchPath)
70 absSearchPath, err := filepath.Abs(searchPath)
71 if err != nil {
71 if err != nil {
72− return fantasy.ToolResponse{}, fmt.Errorf("error resolving search path: %w", err)
72+ return fantasy.NewTextErrorResponse(fmt.Sprintf("error resolving search path: %v", err)), nil
75 relPath, err := filepath.Rel(absWorkingDir, absSearchPath)
75 relPath, err := filepath.Rel(absWorkingDir, absSearchPath)