pub struct ResourceConfig {
pub uri: String,
pub name: String,
pub description: Option<String>,
pub mime_type: String,
pub content: Option<String>,
pub content_file: Option<String>,
pub meta: Option<Map<String, Value>>,
}Expand description
MCP Resource configuration.
Resources provide documentation and context that LLMs can access to better
understand how to use the server’s tools. Resources are loaded at build
time and served via MCP resources/list and resources/read.
Fields§
§uri: StringResource URI (e.g., docs://policies/alcohol-shipment).
name: StringHuman-readable name.
description: Option<String>Description of what this resource contains.
mime_type: StringMIME type (defaults to text/markdown).
content: Option<String>Inline content (mutually exclusive with content_file).
content_file: Option<String>Path to content file, relative to config (mutually exclusive with
content).
Not supported in Lambda; use inline content instead.
meta: Option<Map<String, Value>>Optional metadata map for resource _meta (e.g., widget metadata for
MCP Apps).
Implementations§
Source§impl ResourceConfig
impl ResourceConfig
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validate the resource configuration.
Returns ToolkitError::Synth if neither content nor content_file
is set, or if both are set.
Trait Implementations§
Source§impl Clone for ResourceConfig
impl Clone for ResourceConfig
Source§fn clone(&self) -> ResourceConfig
fn clone(&self) -> ResourceConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResourceConfig
impl Debug for ResourceConfig
Source§impl<'de> Deserialize<'de> for ResourceConfig
impl<'de> Deserialize<'de> for ResourceConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ResourceConfig
impl RefUnwindSafe for ResourceConfig
impl Send for ResourceConfig
impl Sync for ResourceConfig
impl Unpin for ResourceConfig
impl UnsafeUnpin for ResourceConfig
impl UnwindSafe for ResourceConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more