pub struct ToolConstraints {
pub allowed_modes: Option<Vec<String>>,
pub max_results_per_call: Option<usize>,
pub max_items_per_call: Option<usize>,
pub default_response_format: Option<String>,
pub max_bytes_per_read: Option<usize>,
pub max_response_bytes: Option<usize>,
pub allowed_url_schemes: Option<Vec<String>>,
pub denied_url_hosts: Option<Vec<String>>,
}
Expand description
Scoped, optional constraints for a tool to align with safe defaults
Fields§
§allowed_modes: Option<Vec<String>>
Whitelisted modes for tools that support modes (e.g., ‘terminal’)
max_results_per_call: Option<usize>
Cap on results for list/search-like tools
max_items_per_call: Option<usize>
Cap on items scanned for file listing
default_response_format: Option<String>
Default response format if unspecified by caller
max_bytes_per_read: Option<usize>
Cap maximum bytes when reading files
max_response_bytes: Option<usize>
Cap maximum bytes when fetching over the network
allowed_url_schemes: Option<Vec<String>>
Allowed URL schemes for network tools
denied_url_hosts: Option<Vec<String>>
Denied URL hosts or suffixes for network tools
Trait Implementations§
Source§impl Clone for ToolConstraints
impl Clone for ToolConstraints
Source§fn clone(&self) -> ToolConstraints
fn clone(&self) -> ToolConstraints
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ToolConstraints
impl Debug for ToolConstraints
Source§impl Default for ToolConstraints
impl Default for ToolConstraints
Source§fn default() -> ToolConstraints
fn default() -> ToolConstraints
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ToolConstraints
impl<'de> Deserialize<'de> for ToolConstraints
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ToolConstraints
impl RefUnwindSafe for ToolConstraints
impl Send for ToolConstraints
impl Sync for ToolConstraints
impl Unpin for ToolConstraints
impl UnwindSafe for ToolConstraints
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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