Text Content
text_content()
Create a TextContent block from a string.The text content to include in the message
TextContent - An MCP TextContent block
Resource Links
Resource links allow you to reference external resources (images, videos, audio, documents) in messages. Fast Agent automatically infers MIME types from URLs and extracts filenames.resource_link()
Create a ResourceLink from a URL with automatic MIME type inference.The URL to the resource
Optional name for the resource. If not provided, extracts filename from URL
Optional MIME type. If not provided, infers from file extension
Optional description of the resource
ResourceLink - An MCP ResourceLink object
image_link()
Create a ResourceLink for an image URL. Ensures the MIME type is set to an image format.The URL to the image
Optional name for the image. If not provided, extracts filename from URL
Optional MIME type. If not provided, infers from extension (defaults to image/jpeg)
Optional description of the image
ResourceLink - An MCP ResourceLink object with image MIME type
video_link()
Create a ResourceLink for a video URL. Ensures the MIME type is set to a video format.The URL to the video
Optional name for the video. If not provided, extracts filename from URL
Optional MIME type. If not provided, infers from extension (defaults to video/mp4)
Optional description of the video
ResourceLink - An MCP ResourceLink object with video MIME type
YouTube URLs are automatically detected and set to video/mp4 MIME type for optimal compatibility.
audio_link()
Create a ResourceLink for an audio URL. Ensures the MIME type is set to an audio format.The URL to the audio file
Optional name for the audio. If not provided, extracts filename from URL
Optional MIME type. If not provided, infers from extension (defaults to audio/mpeg)
Optional description of the audio
ResourceLink - An MCP ResourceLink object with audio MIME type
Complete Example
Here’s how to use content helpers to build rich messages:MIME Type Inference
Fast Agent automatically infers MIME types from file extensions:- Images:
.jpg,.jpeg,.png,.gif,.webp,.svg, etc. - Videos:
.mp4,.webm,.mov,.avi, etc. - Audio:
.mp3,.wav,.ogg,.m4a, etc. - Documents:
.pdf,.json,.xml,.csv, etc.
mime_type parameter.