pub enum Content {
Text {
text: String,
},
Image {
data: String,
mime_type: String,
},
Detail {
data: Value,
},
Artifact {
capture_id: String,
kind: String,
summary: String,
},
}Expand description
Structured content returned by a tool, aligned with the MCP content
array shape (no envelope, no orchestration/failure/truncation semantics).
Text is the textual face and Image the pictorial one: a tool that
hands the model something to look at returns an Image, and
content_images turns those into the attachments that ride the tool
result to the provider (content_text keeps only the words). Detail
carries machine-readable metadata (e.g. edit line numbers) that the UI
can consume but the LLM never sees.
Variants§
Text
Image
Base64-encoded image payload.
Detail
Machine-readable metadata for UI consumption (not sent to the LLM).
Artifact
A stored observation artifact referenced by id (M3c,
action-executor-design §6): the body is fetched on demand via
obs.fetch; the model face is the summary+reference line carried in
Text — so this typed channel marks the artifact for UI/logs without
duplicating the line.