Skip to content

Commit 04e669a

Browse files
Return plain text for symbol extraction instead of embedded resource
Symbol text is just code — a ResourceContents wrapper with URI/MIME type adds no value. Use NewToolResultText for a simpler, more natural response.
1 parent 9f6f67d commit 04e669a

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

pkg/github/repositories.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -786,18 +786,7 @@ func GetFileContents(t translations.TranslationHelperFunc) inventory.ServerTool
786786
if extractErr != nil {
787787
return utils.NewToolResultError(extractErr.Error()), nil, nil
788788
}
789-
content = symbolText
790-
successMsg := fmt.Sprintf("extracted %s %q from %s", symbolKind, symbol, path)
791-
if fileSHA != "" {
792-
successMsg += fmt.Sprintf(" (SHA: %s)", fileSHA)
793-
}
794-
successMsg += successNote
795-
result := &mcp.ResourceContents{
796-
URI: resourceURI,
797-
Text: content,
798-
MIMEType: contentType,
799-
}
800-
return utils.NewToolResultResource(successMsg, result), nil, nil
789+
return utils.NewToolResultText(fmt.Sprintf("%s %s in %s:\n\n%s", symbolKind, symbol, path, symbolText)), nil, nil
801790
}
802791

803792
result := &mcp.ResourceContents{

0 commit comments

Comments
 (0)