#[non_exhaustive]pub struct ToolHints {
pub read_only: Option<bool>,
pub destructive: Option<bool>,
pub idempotent: Option<bool>,
pub open_world: Option<bool>,
}Expand description
What a tool declares about its own effects, for the host’s tool processors.
Each field is the tool’s own claim and is not verified. None means the
tool did not declare it: Causa fills in no default and never acts on a
value, so a host decides how far to trust each one — for example by
asking about every call of a tool that is not declared read-only. MCP
servers declare the same four hints as tool annotations, and the MCP
adapter in causa-extension carries them over one to one.
Hints sit beside the ToolDefinition, not in it. They never reach the
model or the context: a change in hints alone records no
crate::ToolChange and leaves the rendered request as it was.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.read_only: Option<bool>The tool does not modify its environment.
destructive: Option<bool>The tool may overwrite or delete what exists, rather than only add to it. Meaningful for a tool that is not read-only.
idempotent: Option<bool>Repeating a call with the same arguments has no further effect. Meaningful for a tool that is not read-only.
open_world: Option<bool>The tool reaches entities outside a closed domain, such as the web.
Implementations§
Source§impl ToolHints
impl ToolHints
Sourcepub fn with_read_only(self, read_only: bool) -> Self
pub fn with_read_only(self, read_only: bool) -> Self
Declares whether the tool leaves its environment unchanged.
Sourcepub fn with_destructive(self, destructive: bool) -> Self
pub fn with_destructive(self, destructive: bool) -> Self
Declares whether the tool may overwrite or delete what exists.
Sourcepub fn with_idempotent(self, idempotent: bool) -> Self
pub fn with_idempotent(self, idempotent: bool) -> Self
Declares whether repeating a call has no further effect.
Sourcepub fn with_open_world(self, open_world: bool) -> Self
pub fn with_open_world(self, open_world: bool) -> Self
Declares whether the tool reaches beyond a closed domain.