pub struct ExecuteCommandTool;Expand description
execute_command — spawn a shell, run a command, capture output.
Honors three escape hatches:
ExecContext::token(the main event): cancellation from the reducer aborts the child. This is the Ctrl+C fix.timeoutargument: model-specified per-call cap (capped atCOMMAND_MAX_TIMEOUT_SECS). DefaultCOMMAND_TIMEOUT_SECS.- Dangerous-command blocklist: refuses obvious destructive patterns before spawning.
Trait Implementations§
Source§impl ToolExecutor for ExecuteCommandTool
impl ToolExecutor for ExecuteCommandTool
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Canonical name the model uses to call this tool. Matches
schema().name exactly.Source§fn schema(&self) -> ToolDefinition
fn schema(&self) -> ToolDefinition
JSON-schema description the model sees in the outgoing
request. Adapters translate this into provider-native shape
(Anthropic’s
type: "custom", Gemini’s function_declarations,
OpenAI’s flat tools, Ollama’s function calling). The same
ToolDefinition feeds all four.Source§fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
ctx: ExecContext,
) -> Pin<Box<dyn Future<Output = ToolOutcome> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
ctx: ExecContext,
) -> Pin<Box<dyn Future<Output = ToolOutcome> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Run the tool. The returned
ToolOutcome is passed verbatim
into Msg::ToolFinished — there’s no error-to-outcome
conversion happening outside this function.Source§fn is_internal(&self) -> bool
fn is_internal(&self) -> bool
True for tools that exist for internal dispatch only and
should NOT be advertised to the model (e.g. the MCP proxy
router, which fronts every
mcp__server__tool call — the
individual MCP tools are advertised separately from
state.mcp.servers). Default false.Auto Trait Implementations§
impl Freeze for ExecuteCommandTool
impl RefUnwindSafe for ExecuteCommandTool
impl Send for ExecuteCommandTool
impl Sync for ExecuteCommandTool
impl Unpin for ExecuteCommandTool
impl UnsafeUnpin for ExecuteCommandTool
impl UnwindSafe for ExecuteCommandTool
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> 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