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