pub struct CtxShapeTool;Expand description
Shapes the output of a host-native tool after it ran (concept K2,
“shape, don’t redirect”): a host mod (Claude Code tool.call) forwards the
native Bash stdout here instead of denying the call and forcing a round
trip to ctx_shell. The text it rewrites gets lean-ctx’s secret redaction,
and the result flows through the same dispatch pipeline as every ctx_*
output (sensitivity floor, policy-pack redaction, input filters).
Host-only surface: a host extension calls it directly ($.mcp.call); it is
never advertised and refused through ctx_call — see
dynamic_tools::INTERNAL_HOST_TOOLS.
Trait Implementations§
Source§impl McpTool for CtxShapeTool
impl McpTool for CtxShapeTool
Source§fn produces_machine_readable(&self, _args: Option<&Map<String, Value>>) -> bool
fn produces_machine_readable(&self, _args: Option<&Map<String, Value>>) -> bool
The body replaces a native tool’s output verbatim, so the pipeline must hand it back without hints, nudges or checkpoints — after its redaction, sensitivity and filter passes, which machine-readable calls keep.
Source§fn tool_def(&self) -> Tool
fn tool_def(&self) -> Tool
granular_tool_defs().Source§fn handle(
&self,
args: &Map<String, Value>,
_ctx: &ToolContext,
) -> Result<ToolOutput, ErrorData>
fn handle( &self, args: &Map<String, Value>, _ctx: &ToolContext, ) -> Result<ToolOutput, ErrorData>
ctx provides access to resolved paths and project state.Auto Trait Implementations§
impl Freeze for CtxShapeTool
impl RefUnwindSafe for CtxShapeTool
impl Send for CtxShapeTool
impl Sync for CtxShapeTool
impl Unpin for CtxShapeTool
impl UnsafeUnpin for CtxShapeTool
impl UnwindSafe for CtxShapeTool
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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