Skip to content

Commit ab84610

Browse files
committed
better error message
1 parent a97eaa6 commit ab84610

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/github/repositories.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"io"
99
"net/http"
1010
"net/url"
11-
"os"
1211
"strings"
1312

1413
ghErrors "github.com/github/github-mcp-server/pkg/errors"
@@ -680,7 +679,7 @@ func GetFileContents(getClient GetClientFn, getRawClient raw.GetRawClientFn, t t
680679
if err != nil {
681680
return mcp.NewToolResultError(fmt.Sprintf("failed to marshal resolved refs: %s", err)), nil
682681
}
683-
return mcp.NewToolResultText(fmt.Sprintf("Failed to get raw repository content with response %d, but resolved git ref to %s with possible path matches: %s", rawAPIResponseCode, resolvedRefs, matchingFilesJSON)), nil
682+
return mcp.NewToolResultError(fmt.Sprintf("Resolved potential matches in the repository tree (resolved refs: %s, matching files: %s), but the raw content API returned an unexpected status code %d.", string(resolvedRefs), string(matchingFilesJSON), rawAPIResponseCode)), nil
684683
}
685684

686685
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)