Skip to main content

objectiveai_sdk/mcp/tool/
resource_link.rs

1//! Resource link content block.
2
3use indexmap::IndexMap;
4use schemars::JsonSchema;
5use serde::{Deserialize, Serialize};
6
7/// A resource link included in a prompt or tool call result.
8#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
9#[schemars(rename = "mcp.tool.ResourceLink")]
10pub struct ResourceLink {
11    /// The programmatic name of the resource.
12    pub name: String,
13    /// The URI of this resource.
14    pub uri: String,
15    /// A human-readable display name.
16    #[serde(skip_serializing_if = "Option::is_none")]
17    #[schemars(extend("omitempty" = true))]
18    pub title: Option<String>,
19    /// A description of what this resource represents.
20    #[serde(skip_serializing_if = "Option::is_none")]
21    #[schemars(extend("omitempty" = true))]
22    pub description: Option<String>,
23    /// The MIME type of this resource, if known.
24    #[serde(skip_serializing_if = "Option::is_none")]
25    #[schemars(extend("omitempty" = true))]
26    #[serde(rename = "mimeType")]
27    pub mime_type: Option<String>,
28    /// Icons for the resource link.
29    #[serde(skip_serializing_if = "Option::is_none")]
30    #[schemars(extend("omitempty" = true))]
31    pub icons: Option<Vec<super::super::shared::Icon>>,
32    /// Optional annotations for the client.
33    #[serde(skip_serializing_if = "Option::is_none")]
34    #[schemars(extend("omitempty" = true))]
35    pub annotations: Option<super::super::shared::Annotations>,
36    /// Extension metadata.
37    #[serde(skip_serializing_if = "Option::is_none")]
38    #[schemars(extend("omitempty" = true))]
39    pub _meta: Option<IndexMap<String, serde_json::Value>>,
40}