Skip to content

Commit 8c40155

Browse files
committed
update tool result message about resolved git ref
1 parent 12c2cfe commit 8c40155

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/github/repositories.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,11 @@ func GetFileContents(getClient GetClientFn, getRawClient raw.GetRawClientFn, t t
602602
if err != nil {
603603
return mcp.NewToolResultError(fmt.Sprintf("failed to marshal matching files: %s", err)), nil
604604
}
605-
return mcp.NewToolResultText(fmt.Sprintf("Path did not point to a file or directory, but resolved ref to %s with possible path matches: %s", ref, matchingFilesJSON)), nil
605+
resolvedRefs, err := json.Marshal(rawOpts)
606+
if err != nil {
607+
return mcp.NewToolResultError(fmt.Sprintf("failed to marshal resolved refs: %s", err)), nil
608+
}
609+
return mcp.NewToolResultText(fmt.Sprintf("Path did not point to a file or directory, but resolved git ref to %s with possible path matches: %s", resolvedRefs, matchingFilesJSON)), nil
606610
}
607611

608612
return mcp.NewToolResultError("Failed to get file contents. The path does not point to a file or directory, or the file does not exist in the repository."), nil

0 commit comments

Comments
 (0)