McpServer.Tool.Content.Image (HTTP MCP Server v0.6.0)
View SourceRepresents image content in a tool result.
The image data is stored as-is (not base64-encoded in the struct). Base64 encoding happens during JSON serialization.
Fields
data- The raw binary image data (required)mime_type- The MIME type of the image (required)
Examples
iex> image_data = <<137, 80, 78, 71>>
iex> image = McpServer.Tool.Content.Image.new(data: image_data, mime_type: "image/png")
iex> image.mime_type
"image/png"
Summary
Types
Functions
Creates a new Image content struct.
Parameters
opts- Keyword list with required:dataand:mime_typefields
Examples
iex> image_data = <<255, 216, 255>>
iex> McpServer.Tool.Content.Image.new(data: image_data, mime_type: "image/jpeg")
%McpServer.Tool.Content.Image{data: <<255, 216, 255>>, mime_type: "image/jpeg"}