ToolImage

data class ToolImage(val base64: String, val mimeType: String, val dataKey: String? = null)

An image produced by a tool, sent over MCP as an image content block ({"type": "image", "data": <base64>, "mimeType": ...}). Created by ToolResult.withImage.

Constructors

Link copied to clipboard
constructor(base64: String, mimeType: String, dataKey: String? = null)

Properties

Link copied to clipboard

The image bytes, base64-encoded without line wrapping.

Link copied to clipboard

The ToolResult.data key holding the same base64, which the MCP transport omits from the JSON so the image isn't sent twice. Null when the image isn't in ToolResult.data.

Link copied to clipboard

e.g. image/png or image/jpeg.