Skip to content

Commit d0290bf

Browse files
Include file SHA in symbol extraction text result
1 parent fb8a684 commit d0290bf

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
@@ -786,7 +786,11 @@ func GetFileContents(t translations.TranslationHelperFunc) inventory.ServerTool
786786
if extractErr != nil {
787787
return utils.NewToolResultError(extractErr.Error()), nil, nil
788788
}
789-
return utils.NewToolResultText(fmt.Sprintf("%s %s in %s:\n\n%s", symbolKind, symbol, path, symbolText)), nil, nil
789+
msg := fmt.Sprintf("%s %s in %s", symbolKind, symbol, path)
790+
if fileSHA != "" {
791+
msg += fmt.Sprintf(" (SHA: %s)", fileSHA)
792+
}
793+
return utils.NewToolResultText(fmt.Sprintf("%s:\n\n%s", msg, symbolText)), nil, nil
790794
}
791795

792796
result := &mcp.ResourceContents{

0 commit comments

Comments
 (0)