Skip to main content

ToolHints

Struct ToolHints 

Source
pub struct ToolHints {
Show 14 fields pub readonly: Option<bool>, pub destructive: Option<bool>, pub idempotent: Option<bool>, pub open_world: Option<bool>, pub requires_secrets: Option<bool>, pub long_running: Option<bool>, pub supports_background: Option<bool>, pub concurrency_class: Option<String>, pub cpu_bound: Option<bool>, pub persist_output: Option<bool>, pub capability_id: Option<String>, pub capability_name: Option<String>, pub narration_noun: Option<String>, pub side_effect_class: Option<SideEffectClass>,
}
Expand description

Semantic hints describing a tool’s behavioral properties.

Follows the MCP tool annotations convention (readOnlyHint, destructiveHint, idempotentHint, openWorldHint) plus everruns-specific hints. All fields are optional booleans — None means “unknown/unspecified”. Consumers should treat None as the conservative default (e.g., assume not readonly, assume not idempotent).

These hints are informational — they do not enforce policy. Use ToolPolicy for execution gating (auto vs requires_approval).

Fields§

§readonly: Option<bool>

Tool does not modify any state (read-only queries, lookups). When true: safe to call speculatively, result can be cached.

§destructive: Option<bool>

Tool may irreversibly destroy or delete data. Subset of non-readonly — a tool can be non-readonly (writes) without being destructive (e.g., create/update operations).

§idempotent: Option<bool>

Calling the tool repeatedly with the same arguments produces the same effect. Safe to retry on transient failures.

§open_world: Option<bool>

Tool interacts with external entities beyond the local system (network calls, third-party APIs, cloud services).

§requires_secrets: Option<bool>

Tool requires API keys, credentials, or other secrets to function. Useful for UI to show connection prompts and for LLMs to anticipate authentication failures.

§long_running: Option<bool>

Tool may take significant time to complete (> ~5s typical). Useful for clients to show progress indicators and set timeouts.

§supports_background: Option<bool>

Tool supports detached background execution via spawn_background. When true, the tool may be executed asynchronously outside the current foreground tool call and report status back later.

§concurrency_class: Option<String>

Scheduling conflict key. Tool calls within the same act batch that share a non-empty concurrency_class are executed sequentially in arrival order; calls in different classes (or with no class) run concurrently.

Set this on tools that mutate shared session state so that, e.g., two file writes or two SQL mutations in one batch do not race. Read-only tools should leave this None so they always parallelize. See crate::atoms::tool_scheduler for how the act scheduler consumes it.

§cpu_bound: Option<bool>

Tool performs significant CPU-bound or otherwise non-yielding work in process (e.g. an in-process interpreter). When true, the act scheduler runs the call on its own task (tokio::spawn) so a long CPU burst does not starve the cooperative polling of I/O-bound tools in the same batch.

Distinct from long_running, which describes wall-clock time for I/O-bound work (those tools yield at await points and need no offload).

§persist_output: Option<bool>

Tool output should be persisted to session VFS before truncation. When set, the tool_output_persistence capability (EVE-222, EVE-245) writes stdout to /outputs/{tool_call_id}.stdout and stderr to /outputs/{tool_call_id}.stderr, injecting full_output, total_lines, and output_files into the result.

§capability_id: Option<String>

Capability that contributed this tool definition.

Reporting uses this attribution only as metadata. It must never contain tool arguments, results, prompts, or any other sensitive payload.

§capability_name: Option<String>

Human-readable capability name snapshot for reporting.

§narration_noun: Option<String>

Entity noun for operation-based narration (e.g. “agent”, “harness”). When set, the narration system reads the operation argument and produces verb-based narration like “Created agent: Neon Cartographer” instead of the generic “Ran Manage Agents”.

§side_effect_class: Option<SideEffectClass>

Replay-safety class used by the durable Act activity (EVE-530).

Controls what happens when a worker reclaims a stale running claim: Pure/Idempotent tools are re-executed; AtMostOnce tools are settled as interrupted to prevent double side-effects.

None is treated conservatively as AtMostOnce.

Implementations§

Source§

impl ToolHints

Source

pub fn is_empty(&self) -> bool

Returns true when all fields are None (default/empty state).

Source

pub fn with_readonly(self, value: bool) -> ToolHints

Builder: set readonly hint.

Source

pub fn with_destructive(self, value: bool) -> ToolHints

Builder: set destructive hint.

Source

pub fn with_idempotent(self, value: bool) -> ToolHints

Builder: set idempotent hint.

Source

pub fn with_open_world(self, value: bool) -> ToolHints

Builder: set open_world hint.

Source

pub fn with_capability_attribution( self, capability_id: impl Into<String>, capability_name: Option<impl Into<String>>, ) -> ToolHints

Builder: set reporting attribution.

Source

pub fn with_requires_secrets(self, value: bool) -> ToolHints

Builder: set requires_secrets hint.

Source

pub fn with_long_running(self, value: bool) -> ToolHints

Builder: set long_running hint.

Source

pub fn with_supports_background(self, value: bool) -> ToolHints

Builder: set supports_background hint.

Source

pub fn with_concurrency_class(self, class: impl Into<String>) -> ToolHints

Builder: set the scheduling conflict key (see concurrency_class).

Source

pub fn with_cpu_bound(self, value: bool) -> ToolHints

Builder: set the cpu_bound hint (see cpu_bound).

Source

pub fn with_persist_output(self, value: bool) -> ToolHints

Builder: set persist_output hint.

Source

pub fn with_narration_noun(self, noun: impl Into<String>) -> ToolHints

Builder: set narration noun for operation-based narration.

Source

pub fn with_side_effect_class(self, class: SideEffectClass) -> ToolHints

Builder: set the replay-safety class (EVE-530).

Source

pub fn effective_side_effect_class(&self) -> SideEffectClass

Returns the effective side-effect class, defaulting to AtMostOnce when unset (conservative default).

Trait Implementations§

Source§

impl Clone for ToolHints

Source§

fn clone(&self) -> ToolHints

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ToolHints

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for ToolHints

Source§

fn default() -> ToolHints

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ToolHints

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<ToolHints, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ToolHints

Source§

impl PartialEq for ToolHints

Source§

fn eq(&self, other: &ToolHints) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ToolHints

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ToolHints

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> ParallelSend for T

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more