pub struct ConnectorToolAdapter { /* private fields */ }Expand description
One MCP server tool as a byob tool.
Implementations§
Source§impl ConnectorToolAdapter
impl ConnectorToolAdapter
pub fn new( name: String, plugin: PluginRef, local: bool, tool: ConnectorTool, connector: Arc<dyn Connector>, ) -> Self
Sourcepub fn on_server(self, server: &str) -> Self
pub fn on_server(self, server: &str) -> Self
The server’s key in the plugin’s mcpServers (named on MCP App views).
pub fn server(&self) -> &str
pub fn connector(&self) -> &Arc<dyn Connector> ⓘ
Sourcepub fn connector_tool(&self) -> &ConnectorTool
pub fn connector_tool(&self) -> &ConnectorTool
The MCP tool behind this one (hints for the approval gate: ConnectorTool::needs_approval).
pub fn plugin(&self) -> &PluginRef
Trait Implementations§
Source§impl Tool for ConnectorToolAdapter
impl Tool for ConnectorToolAdapter
Source§fn access(&self, _args: &Value) -> Access
fn access(&self, _args: &Value) -> Access
A local server is unsandboxed code on this computer (Execute); an online one only
reaches the network. Read-only hints are on Self::connector_tool for a finer gate.
fn spec(&self) -> ToolSpec
Source§fn title(&self, _args: &Value) -> String
fn title(&self, _args: &Value) -> String
Short human title for the finished call, e.g. “Wrote notes.md”.
args is untrusted.Source§fn run(&self, args: &Value, ctx: &ToolContext<'_>) -> ToolOutput
fn run(&self, args: &Value, ctx: &ToolContext<'_>) -> ToolOutput
Do it.
args is untrusted model output: validate everything, never panic.Source§fn pending_title(&self, _args: &Value) -> String
fn pending_title(&self, _args: &Value) -> String
Title for the call before and while it runs, and on approval cards, e.g.
“Write notes.md”. Defaults to “Run ”.
Source§fn preview(&self, args: &Value, _workspace: &Path) -> Option<Preview>
fn preview(&self, args: &Value, _workspace: &Path) -> Option<Preview>
A readable account of what the call would do, for approval cards: e.g. a diff for a
file write. Reads only, no side effects; bounded. Defaults to the key arguments.
Source§fn always_ask(&self, _args: &Value) -> Option<String>
fn always_ask(&self, _args: &Value) -> Option<String>
Some(warning) if this call must be approved by a person every time: no policy,
“always allow” grant or --auto-approve lets it run (e.g. installing system-wide).
The warning is shown on the approval card.Source§fn card(&self, _args: &Value) -> Option<Card>
fn card(&self, _args: &Value) -> Option<Card>
The card a person confirms this call on, in plain words (
Card); None: the
preview, then the arguments in full. Only used for calls that must be confirmed.Source§fn concurrent(&self) -> bool
fn concurrent(&self) -> bool
Calls of this tool start before the other calls of the same round and run side by
side, each on a thread of its own (results still go back in call order). For tools
that mostly wait, like
delegate.Source§fn repeatable(&self, _args: &Value) -> bool
fn repeatable(&self, _args: &Value) -> bool
The same call can mean something new each time, so the turn’s repeat guard (“you
already called this”) lets it through: reads of state that changes, or undo.
Auto Trait Implementations§
impl !RefUnwindSafe for ConnectorToolAdapter
impl !UnwindSafe for ConnectorToolAdapter
impl Forget for ConnectorToolAdapter
impl Freeze for ConnectorToolAdapterwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
*const ArcInner<dyn Connector> is !null: Freeze,
PhantomData<ArcInner<dyn Connector>>: Freeze,
impl Move for ConnectorToolAdapter
impl Send for ConnectorToolAdapter
impl Sync for ConnectorToolAdapter
impl Unpin for ConnectorToolAdapter
impl UnsafeUnpin for ConnectorToolAdapterwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
*const ArcInner<dyn Connector> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Connector>>: UnsafeUnpin,
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