MCPcopy
hub / github.com/codeaashu/claude-code / createImageResponse

Function createImageResponse

src/tools/FileReadTool/FileReadTool.ts:784–799  ·  view source on GitHub ↗
(
  buffer: Buffer,
  mediaType: string,
  originalSize: number,
  dimensions?: ImageDimensions,
)

Source from the content-addressed store, hash-verified

782}
783
784function createImageResponse(
785 buffer: Buffer,
786 mediaType: string,
787 originalSize: number,
788 dimensions?: ImageDimensions,
789): ImageResult {
790 return {
791 type: 'image',
792 file: {
793 base64: buffer.toString('base64'),
794 type: `image/${mediaType}` as Base64ImageSource['media_type'],
795 originalSize,
796 dimensions,
797 },
798 }
799}
800
801/**
802 * Inner implementation of call, separated to allow ENOENT handling in the outer call.

Callers 1

readImageWithTokenBudgetFunction · 0.85

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected