pub struct CodeModeToolBuilder { /* private fields */ }Expand description
Builder for standard Code Mode tool definitions.
Implementations§
Source§impl CodeModeToolBuilder
impl CodeModeToolBuilder
Sourcepub fn build_tools(&self) -> Vec<ToolInfo>
pub fn build_tools(&self) -> Vec<ToolInfo>
Build the standard Code Mode tools.
pub fn build_validate_tool(&self) -> ToolInfo
Sourcepub fn build_execute_tool(&self) -> ToolInfo
pub fn build_execute_tool(&self) -> ToolInfo
Build the execute_code tool definition.
Deliberately carries NO annotations. readOnlyHint/destructiveHint are
the hints a host reads to decide whether a call needs human confirmation,
and this tool runs caller-supplied code against the app’s op surface — a
hardcoded “read-only, non-destructive, idempotent” would be a false safety
claim for any app that exposes a single mutating op, and nothing here
enforces that it does not.
The durable fix is to DERIVE the hints rather than hardcode them, and the
pieces already converge: OperationRegistry::lookup_category (config.rs),
the ValidationPipeline the generated handler already owns at its
metadata() call site (pmcp-code-mode-derive), and the per-script fold
precedent in javascript.rs (is_read_only); the full Cedar/AVP design
layers on policy_annotations.rs. Until then the MCP defaults
(readOnlyHint = false, destructiveHint = true) are the honest answer.
Auto Trait Implementations§
impl Freeze for CodeModeToolBuilder
impl RefUnwindSafe for CodeModeToolBuilder
impl Send for CodeModeToolBuilder
impl Sync for CodeModeToolBuilder
impl Unpin for CodeModeToolBuilder
impl UnsafeUnpin for CodeModeToolBuilder
impl UnwindSafe for CodeModeToolBuilder
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
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