pub struct ToolCallMetadata {Show 39 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 created_resource_id: Option<String>,
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: ToolReceiptKindProtocol 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: ToolAccessEnforcementWhether 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: ToolInvocationStageAuthoritative pipeline stage for this result. Completion and effect projection must never infer dispatch from intended call semantics.
contract_rejected: boolThe 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: boolTrue 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: boolTrue when tool execution exceeded a timeout threshold.
background_started: boolTrue when execution moved to background tracking.
detached: boolTrue when the process is detached and intentionally long-lived.
completion_notifications_enabled: boolTrue 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.
created_resource_id: Option<String>Canonical id of the resource a successful write created, read by the
adapter from the response’s machine format (JSON /data/id or /id)
and validated as [A-Za-z0-9_-]{1,64}. Never model or prose 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.
Exact pre-I/O authorization readiness for autonomous authenticated adapters. It is persisted with the receipt and never contains secrets.
background_handoff: boolThe 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: boolThe 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: usizeHow many runs this call launched, still working when it returned or run to their end within it (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. One run that names no items and ends within the call took on the whole request.
changes_untyped: boolThe 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: ToolCallSemanticsCompletion 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: boolPreserve 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: boolKeep 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: boolDo 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
impl Clone for ToolCallMetadata
Source§fn clone(&self) -> ToolCallMetadata
fn clone(&self) -> ToolCallMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolCallMetadata
impl Debug for ToolCallMetadata
Source§impl Default for ToolCallMetadata
impl Default for ToolCallMetadata
Source§fn default() -> ToolCallMetadata
fn default() -> ToolCallMetadata
Source§impl<'de> Deserialize<'de> for ToolCallMetadata
impl<'de> Deserialize<'de> for ToolCallMetadata
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolCallMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolCallMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for ToolCallMetadata
Source§impl PartialEq for ToolCallMetadata
impl PartialEq for ToolCallMetadata
Source§impl Serialize for ToolCallMetadata
impl Serialize for ToolCallMetadata
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for ToolCallMetadata
Auto Trait Implementations§
impl Forget for ToolCallMetadata
impl Freeze for ToolCallMetadatawhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<ToolTargetHint>: Freeze,
PhantomData<ToolEvidenceCapability>: Freeze,
PhantomData<String>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<ToolObservationEvidence>: Freeze,
PhantomData<ToolCollectionObservation>: Freeze,
PhantomData<MessageAttachment>: Freeze,
*const RuntimePreparationFailure is !null: Freeze,
PhantomData<RuntimePreparationFailure>: Freeze,
impl Move for ToolCallMetadata
impl RefUnwindSafe for ToolCallMetadata
impl Send for ToolCallMetadata
impl Sync for ToolCallMetadata
impl Unpin for ToolCallMetadata
impl UnsafeUnpin for ToolCallMetadatawhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<ToolTargetHint>: UnsafeUnpin,
PhantomData<ToolEvidenceCapability>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<ToolObservationEvidence>: UnsafeUnpin,
PhantomData<ToolCollectionObservation>: UnsafeUnpin,
PhantomData<MessageAttachment>: UnsafeUnpin,
*const RuntimePreparationFailure is !null: UnsafeUnpin,
PhantomData<RuntimePreparationFailure>: UnsafeUnpin,
impl UnwindSafe for ToolCallMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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