Skip to main content

objectiveai_sdk/mcp/shared/
icon.rs

1//! Icon types for MCP entities.
2
3use schemars::JsonSchema;
4use serde::{Deserialize, Serialize};
5
6/// Theme preference for an icon.
7#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, JsonSchema)]
8#[serde(rename_all = "lowercase")]
9#[schemars(rename = "mcp.shared.IconTheme")]
10pub enum IconTheme {
11    #[schemars(title = "Light")]
12    Light,
13    #[schemars(title = "Dark")]
14    Dark,
15}
16
17/// An icon that can be displayed in a user interface.
18#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
19#[schemars(rename = "mcp.shared.Icon")]
20pub struct Icon {
21    /// URL or data URI for the icon.
22    pub src: String,
23    /// MIME type for the icon.
24    #[serde(skip_serializing_if = "Option::is_none")]
25    #[schemars(extend("omitempty" = true))]
26    #[serde(rename = "mimeType")]
27    pub mime_type: Option<String>,
28    /// Sizes at which the icon can be used (e.g., "48x48", "96x96", "any").
29    #[serde(skip_serializing_if = "Option::is_none")]
30    #[schemars(extend("omitempty" = true))]
31    pub sizes: Option<Vec<String>>,
32    /// Theme this icon is intended for.
33    #[serde(skip_serializing_if = "Option::is_none")]
34    #[schemars(extend("omitempty" = true))]
35    pub theme: Option<IconTheme>,
36}