Skip to content

Commit 9e735aa

Browse files
committed
mcp: search_file_content: fix "path is empty" error
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
1 parent e5cc00f commit 9e735aa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/mcp/toolset/filesystem.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ func (ts *ToolSet) SearchFileContent(ctx context.Context,
158158
guestPath = path.Join(guestPath, *args.Include)
159159
}
160160
cmdToolRes, cmdRes, err := ts.RunShellCommand(ctx, req, msi.RunShellCommandParams{
161-
Command: []string{"git", "grep", "-n", "--no-index", args.Pattern, guestPath},
161+
Command: []string{"git", "grep", "-n", "--no-index", args.Pattern, guestPath},
162+
Directory: pathStr, // Directory must be always set
162163
})
163164
if err != nil {
164165
return cmdToolRes, nil, err

0 commit comments

Comments
 (0)