Skip to content

Graphorin API reference v0.7.0


Graphorin API reference / @graphorin/core / / toolReturn

Function: toolReturn()

ts
function toolReturn<TOutput>(fields): ToolReturn<TOutput>;

Defined in: packages/core/src/contracts/tool.ts:288

W-115: build a BRANDED ToolReturn envelope. The executor unwraps branded envelopes unconditionally; unbranded objects fall to a deliberately narrow structural sniff (own keys within {output, contentParts, taint}), so a tool legitimately returning { output, exitCode, stderr } is no longer silently stripped to its output field.

Type Parameters

Type Parameter
TOutput

Parameters

ParameterType
fields{ contentParts?: readonly MessageContent[]; output: TOutput; taint?: { sensitive?: boolean; sourceKind?: string; untrusted?: boolean; }; }
fields.contentParts?readonly MessageContent[]
fields.outputTOutput
fields.taint?{ sensitive?: boolean; sourceKind?: string; untrusted?: boolean; }
fields.taint.sensitive?boolean
fields.taint.sourceKind?string
fields.taint.untrusted?boolean

Returns

ToolReturn&lt;TOutput&gt;

Stable