Whatever message this page gives is out now! Go check it out!

readResource

Last update:
May 18, 2026
Retrieves the full content of a specific resource from the MCP server by URI, returning the resource content and metadata such as MIME type and encoding.

Description

The readResource function retrieves the full content of a specific resource from the MCP server, identified by its URI. This method enables your ColdFusion application to access external files, documents, logs, or other read-only resources exposed by the server, provided you have permission. The returned result includes the resource content and metadata such as MIME type and encoding.

Returns

A struct containing the resource content and metadata.

Category

MCP functions

Syntax

readResource(string uri)
Called as an instance method on an MCP client:
resourceData = mcpClient.readResource(resourceUri);

History

New in ColdFusion 2025.0.08

Parameters

readResource parameters
FieldData typeRequiredDescription
uriStringYesThe unique URI of the resource to retrieve, e.g. "file:///logs/app.log" or "healthcare://patientdata/P001/ct-scan".

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page