pub fn image_url_content(
url: impl Into<String>,
mime_type: Option<String>,
) -> ValueExpand description
Helper to create an image content response with URL
Creates a standard MCP image content response with image URL:
{
"content": [{
"type": "image",
"imageUrl": "https://example.com/image.png",
"mimeType": "image/png"
}]
}Use case: Return image by URL reference
§Example
ⓘ
fn handle_get_product_image(args: &Value) -> Result<Value, String> {
let url = format!("https://cdn.example.com/products/{}.jpg", product_id);
Ok(image_url_content(url, Some("image/jpeg".to_string())))
}