mcpResourceLink

Builds a resource-link MCP content block. A resource link points at addressable content the model can read, without embedding the content itself. The uri identifies the resource; name, description, and mimeType are optional metadata. Omitted optional fields are left out rather than written as null. The block passes through the automatic result coercion untouched.

mcpResourceLink( uri [, name [, description [, mimeType]]] ) → returns struct

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

Argument Reference

uri string
Required

The URI of the resource the link points to, e.g. "doc://pages/intro".

name string

A human-readable name for the resource.

description string

A human-readable description of the resource.

mimeType string

The MIME type of the resource, e.g. "text/markdown".

Links more information about mcpResourceLink

Examples
Sample code invoking the mcpResourceLink function

Return a text block plus a resource link in a single content list.

function search( required string query ) tool="search_docs" {
    return [
        mcpText( "Here is the chart:" ),
        mcpResourceLink( "doc://pages/intro", "intro", "The introduction", "text/markdown" )
    ];
}

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

Fork me on GitHub