The MCP SDK handles base64 encoding during JSON marshaling, so the Data
field should contain raw binary data, not pre-encoded base64 strings.
This prevents double-encoding where base64 strings were being encoded again.
- Updated NewToolResultResourceWithFlag to pass raw binary data
- Updated test to verify raw binary data instead of base64 string
- Removed unused encoding/base64 imports
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
- Added FeatureFlagDisableEmbeddedResources constant to feature_flags.go
- Implemented NewToolResultResourceWithFlag in utils/result.go
- When flag is enabled, returns TextContent for text files
- Returns ImageContent with base64 data for binary files
- Maintains backward compatibility when flag is disabled
- Updated get_file_contents tool to check feature flag and use new function
- Added comprehensive tests for both utils function and integration with get_file_contents
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>