pub struct ScriptTool { /* private fields */ }Expand description
A single script tool (plugs into the Tool table; Box::leak naming follows the existing
McpToolAdapter precedent).
Global scripts use ScriptTool::new (key = script.{name}); the plugin script form uses
ScriptTool::with_key in P2 to mount plugin.{plugin}.{tool}.
Implementations§
Source§impl ScriptTool
impl ScriptTool
Sourcepub fn new(entry: ScriptToolEntry) -> Self
pub fn new(entry: ScriptToolEntry) -> Self
Global script tool: key = script.{name}.
Sourcepub fn with_key(identity_key: &str, entry: ScriptToolEntry) -> Self
pub fn with_key(identity_key: &str, entry: ScriptToolEntry) -> Self
Explicit identity key (plugin script form: plugin.{plugin}.{tool}).
pub fn entry(&self) -> &ScriptToolEntry
Trait Implementations§
Source§impl Tool for ScriptTool
impl Tool for ScriptTool
fn name(&self) -> &'static str
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
Human-readable description of what this tool does and when to use it.
Source§fn schema(&self) -> Value
fn schema(&self) -> Value
JSON Schema for the tool’s input arguments (MCP
inputSchema shape,
without the provider envelope).fn call<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: &'life1 Value,
ctx: &'life2 ToolContext,
) -> Pin<Box<dyn Future<Output = AgentResult<Vec<Content>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn metadata(&self) -> ToolMetadata
fn metadata(&self) -> ToolMetadata
Machine-readable metadata for tool introspection. Read more
Source§fn exposure(&self) -> ToolExposure
fn exposure(&self) -> ToolExposure
Visibility level for this tool. Default:
Direct (always visible). Read moreSource§fn call_timeout_ms(&self, _args: &Value) -> Option<u64>
fn call_timeout_ms(&self, _args: &Value) -> Option<u64>
Execution budget for a specific call, derived from its
args. Read moreSource§fn should_activate(&self, _ctx: &ActivationContext) -> bool
fn should_activate(&self, _ctx: &ActivationContext) -> bool
Activation condition for
Deferred tools. Read moreAuto Trait Implementations§
impl Forget for ScriptTool
impl Freeze for ScriptTool
impl Move for ScriptTool
impl RefUnwindSafe for ScriptTool
impl Send for ScriptTool
impl Sync for ScriptTool
impl Unpin for ScriptTool
impl UnsafeUnpin for ScriptTool
impl UnwindSafe for ScriptTool
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