mcpText

Builds a text MCP content block. The block passes through the automatic result coercion untouched, so use it when a tool wants exact control over what the client renders. Returns a struct with type = "text" and the given text.

mcpText( text ) → returns struct

This function requires RustCFML.  Not supported on Lucee, Adobe ColdFusion, etc.

Argument Reference

text string
Required

The text content to render.

Links more information about mcpText

Examples
Sample code invoking the mcpText function

A tool can return an explicit content block instead of relying on automatic coercion.

function chart() tool="chart" {
    return mcpText( "Here is the chart:" );
}

Expected Result: { type: "text", text: "Here is the chart:" }

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub