pub struct ToolSpec {
pub name: &'static str,
pub description: &'static str,
pub input_schema: fn() -> Value,
pub data_schema: DataSchema,
pub mutates: bool,
pub facet: Facet,
pub handler: fn(&Ctx, &Value) -> Result<ToolOutcome, EngineFault>,
}Expand description
One tool, shared verbatim by the CLI and the MCP server (design §2.2).
Fields§
§name: &'static strWire name, e.g. "render". Also the CLI subcommand stem.
description: &'static strHuman/agent-facing description. This is ALSO the embedded agent prompt —
it carries behavioral guidance, not just a label — and is rendered into
MCP tools/list and scrybe <cmd> --help verbatim.
input_schema: fn() -> ValueJSON Schema for arguments (MCP inputSchema; also drives CLI arg parse).
data_schema: DataSchemaVersioned, typed schema for the tool’s stable data payload.
mutates: boolDoes this tool change editor/disk/app state? Gates read-only agents and dry-run mode.
facet: FacetTool group for progressive disclosure + feature gating.
handler: fn(&Ctx, &Value) -> Result<ToolOutcome, EngineFault>The one implementation, shared by both front ends. Ok(outcome) even
for business failures (a tool_error inside the outcome); Err is
reserved for EngineFaults — e.g. the transport failing mid-request.
Auto Trait Implementations§
impl Freeze for ToolSpec
impl RefUnwindSafe for ToolSpec
impl Send for ToolSpec
impl Sync for ToolSpec
impl Unpin for ToolSpec
impl UnsafeUnpin for ToolSpec
impl UnwindSafe for ToolSpec
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
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>
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>
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