pub struct WebFetchTool {
pub mode: WebFetchMode,
pub blocked_domains: HashSet<String>,
pub blocked_patterns: Vec<String>,
pub allowed_domains: HashSet<String>,
pub strict_https_only: bool,
}Expand description
WebFetch tool that fetches URL content and processes it with AI
Fields§
§mode: WebFetchModeSecurity mode: restricted (blocklist) or whitelist (allowlist)
blocked_domains: HashSet<String>Additional blocked domains (merged with builtin)
blocked_patterns: Vec<String>Additional blocked patterns (merged with builtin)
allowed_domains: HashSet<String>Allowed domains (for exemptions in restricted mode or primary list in whitelist mode)
strict_https_only: boolStrict HTTPS-only mode
Implementations§
Source§impl WebFetchTool
impl WebFetchTool
pub fn new() -> Self
Sourcepub fn with_config(
mode: WebFetchMode,
blocked_domains: Vec<String>,
blocked_patterns: Vec<String>,
allowed_domains: Vec<String>,
strict_https_only: bool,
) -> Self
pub fn with_config( mode: WebFetchMode, blocked_domains: Vec<String>, blocked_patterns: Vec<String>, allowed_domains: Vec<String>, strict_https_only: bool, ) -> Self
Create a WebFetchTool with custom configuration
Sourcepub fn from_config(config: &WebFetchConfig) -> Self
pub fn from_config(config: &WebFetchConfig) -> Self
Build a WebFetchTool from a WebFetchConfig value-object. This is
the entry point the tool registry uses so user-configured
allow/block lists and HTTPS settings actually take effect.
Trait Implementations§
Source§impl Clone for WebFetchTool
impl Clone for WebFetchTool
Source§impl Default for WebFetchTool
impl Default for WebFetchTool
Source§impl Tool for WebFetchTool
impl Tool for WebFetchTool
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the tool with given arguments Read more
Source§fn description(&self) -> &str
fn description(&self) -> &str
Get the tool’s description
Source§fn execute_dual<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<SplitToolResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_dual<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<SplitToolResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute with dual-channel output (LLM summary + UI content) Read more
Source§fn parameter_schema(&self) -> Option<Value>
fn parameter_schema(&self) -> Option<Value>
Optional JSON schema for the tool’s parameters, if available.
Source§fn config_schema(&self) -> Option<Value>
fn config_schema(&self) -> Option<Value>
Optional JSON schema for the tool’s configuration, if available.
Source§fn state_schema(&self) -> Option<Value>
fn state_schema(&self) -> Option<Value>
Optional JSON schema describing state persisted by the tool, if any.
Source§fn prompt_path(&self) -> Option<Cow<'static, str>>
fn prompt_path(&self) -> Option<Cow<'static, str>>
Optional prompt path metadata (e.g., for loading companion prompts).
Source§fn default_permission(&self) -> ToolPolicy
fn default_permission(&self) -> ToolPolicy
Default execution policy for this tool.
Source§fn allow_patterns(&self) -> Option<&'static [&'static str]>
fn allow_patterns(&self) -> Option<&'static [&'static str]>
Optional allowlist patterns the tool considers pre-approved.
Source§fn deny_patterns(&self) -> Option<&'static [&'static str]>
fn deny_patterns(&self) -> Option<&'static [&'static str]>
Optional denylist patterns the tool considers blocked.
Source§fn is_mutating(&self) -> bool
fn is_mutating(&self) -> bool
Whether this tool mutates state (files, environment, etc). Read more
Source§fn is_parallel_safe(&self) -> bool
fn is_parallel_safe(&self) -> bool
Whether this tool is safe to run in parallel with other tools. Read more
Source§fn kind(&self) -> &'static str
fn kind(&self) -> &'static str
Get the kind/category of this tool for matching against policies. Read more
Source§fn matches_kind(&self, pattern: &str) -> bool
fn matches_kind(&self, pattern: &str) -> bool
Check if this tool matches a given kind pattern. Read more
Source§fn resource_hints(&self, _args: &Value) -> Vec<String>
fn resource_hints(&self, _args: &Value) -> Vec<String>
Resources this tool might access (paths, URLs, etc). Read more
Source§fn execution_cost(&self) -> u8
fn execution_cost(&self) -> u8
Estimated execution cost (1-10 scale). Read more
Auto Trait Implementations§
impl Forget for WebFetchTool
impl Freeze for WebFetchTool
impl Move for WebFetchTool
impl RefUnwindSafe for WebFetchTool
impl Send for WebFetchTool
impl Sync for WebFetchTool
impl Unpin for WebFetchTool
impl UnsafeUnpin for WebFetchTool
impl UnwindSafe for WebFetchTool
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
impl<T> CacheValue for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
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> 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 moreSource§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
Source§type NoneType = T
type NoneType = T
The type of the none-equivalent value that
NoneValue::null_value produces.Source§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.