Builds an audio MCP content block. data is a base64-encoded string of the audio bytes and mimeType is the audio's MIME type (e.g. "audio/mpeg"). 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.
mcpAudio( data [, mimeType] )
→ returns struct
A tool can return an explicit audio block alongside a text block.
function greeting() tool="greeting" {
var bytes = synthesizeGreeting();
return [
mcpText( "Your greeting is ready:" ),
mcpAudio( toBase64( bytes ), "audio/mpeg" )
];
}
Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.