Skip to main content

ToolCallMetadata

Struct ToolCallMetadata 

Source
pub struct ToolCallMetadata {
Show 38 fields pub receipt_kind: ToolReceiptKind, pub access_manifest: Option<ToolCallAccessManifest>, pub access_enforcement: ToolAccessEnforcement, pub access_denial: Option<ToolAccessDenial>, pub outcome_status: Option<ToolOutcomeStatus>, pub invocation_stage: ToolInvocationStage, pub contract_rejected: bool, pub effective_tool_name: Option<String>, pub receipt_replayed: bool, pub exit_code: Option<i32>, pub timed_out: bool, pub background_started: bool, pub detached: bool, pub completion_notifications_enabled: bool, pub transport_error: Option<String>, pub http_status: Option<u16>, pub truncation: Option<TruncationInfo>, pub result_provenance: Option<ToolResultProvenance>, pub authorization_preflight: Option<AuthorizationPreflightRecord>, pub background_handoff: bool, pub background_settled: bool, pub background_run_labels: Vec<String>, pub checklist_items: Vec<usize>, pub launched_runs: usize, pub changes_untyped: bool, pub semantics: ToolCallSemantics, pub observations: Vec<ToolObservationEvidence>, pub collection_observations: Vec<ToolCollectionObservation>, pub read_file: Option<ReadFileResultMetadata>, pub attachments: Vec<MessageAttachment>, pub runtime_preparation_failure: Option<Box<RuntimePreparationFailure>>, pub untrusted_verbatim: bool, pub preserve_inline: bool, pub persistent_output: Option<String>, pub suppress_activity_result: bool, pub presentation: Option<ToolResultPresentation>, pub internal_identifiers: Vec<String>, pub output_trust: Option<SourceTrust>,
}
Expand description

Structured execution metadata returned by tools.

This is intentionally minimal and backward-compatible: tools can continue returning plain text while selectively populating structured fields.

Fields§

§receipt_kind: ToolReceiptKind

Protocol family for fields whose applicability differs by adapter. The dispatcher stamps this from the registered tool before completion evaluation; tools do not need to repeat the declaration per result.

§access_manifest: Option<ToolCallAccessManifest>

Effective filesystem access contract enforced for this invocation. This is an audit receipt, not a reusable authority grant.

§access_enforcement: ToolAccessEnforcement

Whether the declared access manifest was installed at an execution boundary. A populated manifest with Unknown is audit data only.

§access_denial: Option<ToolAccessDenial>

Kernel/adapter denial details when a dispatched process was prevented from opening a path. The declared manifest is retained separately.

§outcome_status: Option<ToolOutcomeStatus>

Authoritative domain outcome when the tool can provide one. Older tools may omit it; the loop then derives a conservative status from structured exit/HTTP/transport metadata before falling back to legacy text parsing.

§invocation_stage: ToolInvocationStage

Authoritative pipeline stage for this result. Completion and effect projection must never infer dispatch from intended call semantics.

§contract_rejected: bool

The adapter deterministically rejected the invocation contract before performing domain I/O. This is an authoritative negative outcome, not evidence that the requested read/write itself occurred.

§effective_tool_name: Option<String>

Actual adapter that produced the result when dispatch was routed from the requested tool through another implementation.

§receipt_replayed: bool

True when the dispatcher reconstructed this outcome from a prior durable receipt instead of invoking the side effect again.

§exit_code: Option<i32>

Process exit code when applicable (e.g. terminal/run_command style tools).

§timed_out: bool

True when tool execution exceeded a timeout threshold.

§background_started: bool

True when execution moved to background tracking.

§detached: bool

True when the process is detached and intentionally long-lived.

§completion_notifications_enabled: bool

True when the tool guarantees automatic completion delivery for a backgrounded operation in the current run.

§transport_error: Option<String>

Transport/runtime failure outside normal tool semantics.

§http_status: Option<u16>

HTTP status code for API tools (http_request, web_fetch). Populated at the tool boundary — not scraped from result text.

§truncation: Option<TruncationInfo>

Output truncation performed at the tool boundary. Rendered into the model-visible text by the loop after ledger/classifier consumption.

§result_provenance: Option<ToolResultProvenance>

Strong provenance for the result body. Populated centrally by the tool dispatcher so individual adapters cannot silently omit it.

§authorization_preflight: Option<AuthorizationPreflightRecord>

Exact pre-I/O authorization readiness for autonomous authenticated adapters. It is persisted with the receipt and never contains secrets.

§background_handoff: bool

The call handed the rest of the turn’s work to a background job whose result reaches the session later (a launch moved to background tracking, a background sub-agent). Set with the call’s finish by ToolCallOutcome::handed_to_background; unlike background_started it says nothing about the receipt’s status.

§background_settled: bool

The call observed the end of a background job a launch left running (a check that returned its finished result, or a cancel). The run pairs it with background_started launches to know whether work it handed off is still running when the model wants to stop.

§background_run_labels: Vec<String>

The names, as the owner reads them, of the runs this call left running in the background (a helper, a command, a CLI agent; every child of a batch call, in order): the turn’s launch line names its runs from these, never from the call’s text (live 2026-11-14: a batch of two named only its first child).

§checklist_items: Vec<usize>

The declared checklist items (their indices) this call took on: a launch hands them to the job it starts (checklist_items). Typed attribution of work to declared items, never read from text.

§launched_runs: usize

How many runs this call left working (a batch launch starts one per child). Each run takes on its own work: a launch of two helpers that names no items is two attempts, never one.

§changes_untyped: bool

The call changed something its semantics could not type (a write inside docker exec or ssh, judged from the command’s structure): the runtime may attribute it to the one checklist item in progress. Never itself a typed change.

§semantics: ToolCallSemantics

Completion semantics for this specific tool call.

§observations: Vec<ToolObservationEvidence>

Exact subject/facet observations made by this dispatched result. These are intentionally separate from ToolCallSemantics: proposed call semantics must never become proof merely because dispatch was planned.

§collection_observations: Vec<ToolCollectionObservation>

Collection membership and coverage observed by this dispatched result.

§read_file: Option<ReadFileResultMetadata>

Complete typed result for successful text-file reads.

§attachments: Vec<MessageAttachment>

Image (or other) files produced by the tool for agent vision context.

§runtime_preparation_failure: Option<Box<RuntimePreparationFailure>>

The runtime’s own pre-dispatch preparation failed (for example materializing a declared write root), attributed to the exact argument declaration that caused it. Set only when no domain I/O ran.

§untrusted_verbatim: bool

Preserve exact, untrusted bytes while still wrapping them as untrusted tool data. Intended for canonical-history evidence whose wording must not be rewritten by prompt-injection sanitization.

§preserve_inline: bool

Keep bounded tool output inline and never write it to a temporary spill file or run lossy generic compression.

§persistent_output: Option<String>

Durable audit representation. The full output remains available to the current model turn, but only this stub is written to canonical events.

§suppress_activity_result: bool

Do not copy result content into executor task-activity telemetry.

§presentation: Option<ToolResultPresentation>

Presentation policy for this result. NaturalSummary asks the response layer to communicate the user-level outcome without exposing control- plane bookkeeping. DiagnosticDetail is selected only when the caller explicitly requested those details.

§internal_identifiers: Vec<String>

Exact control-plane identifiers observed by the tool. They remain available to the agent/runtime but are omitted from a natural summary unless the owner supplied the same identifier or requested diagnostics.

§output_trust: Option<SourceTrust>

Who authored this exact output, when the tool knows better than its declared Tool::output_trust (a delegated run reports whether it read untrusted content). The dispatcher stamps this over the declaration.

Trait Implementations§

Source§

impl Clone for ToolCallMetadata

Source§

fn clone(&self) -> Self

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 ToolCallMetadata

Source§

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

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

impl Default for ToolCallMetadata

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for ToolCallMetadata

Source§

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

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

impl Eq for ToolCallMetadata

Source§

impl PartialEq for ToolCallMetadata

Source§

fn eq(&self, other: &Self) -> 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 ToolCallMetadata

Source§

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

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

impl StructuralPartialEq for ToolCallMetadata

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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