Builds an image MCP content block. data is a base64-encoded string of the image bytes and mimeType is the image's MIME type (e.g. "image/png"). The block passes through the automatic result coercion untouched, so use it when a tool wants exact control over what the client renders. An omitted mimeType is left out rather than written as null.
mcpImage( data [, mimeType] )
→ returns struct
Pair a text block with an image block in a single content list.
function chart() tool="chart" {
var bytes = renderChart();
return [
mcpText( "Here is the chart:" ),
mcpImage( toBase64( bytes ), "image/png" )
];
}
Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.