Skip to main content

poem_mcpserver/protocol/
content.rs

1//! Content type.
2
3use serde::Serialize;
4use serde_json::Value;
5
6/// A content that can be sent to the client.
7#[derive(Debug, Serialize)]
8#[serde(rename_all = "camelCase", tag = "type")]
9pub enum Content {
10    /// A text content.
11    Text {
12        /// The text content.
13        text: String,
14    },
15    /// An image content.
16    Image {
17        /// The image data.
18        data: String,
19        /// The MIME type of the image.
20        mime_type: String,
21    },
22    /// A link to a resource.
23    ResourceLink {
24        /// The URI of the resource.
25        uri: String,
26        /// The name of the resource.
27        name: String,
28        /// The description of the resource.
29        description: String,
30        /// The MIME type of the resource.
31        mime_type: String,
32        /// Additional annotations for the resource.
33        annotations: Value,
34    },
35}