Interface: RawToolCall
Plain input object supplied to ToolCall at construction time.
Remarks
Validated against rawToolCallSchema before the ToolCall instance is created. Temporal fields accept any value that Luxon can parse — ISO strings, Unix timestamps, Date objects, or existing DateTime instances.
Properties
| Property | Type | Default value | Description |
|---|---|---|---|
args | | string | Record<string, unknown> | undefined | Arguments the model supplied for this tool call. Remarks Accepts either a plain object or a JSON-encoded string that deserialises to an object. Always exposed as a plain object on the constructed ToolCall instance. |
checksum | string | undefined | Integrity checksum over tool and args; can be used to detect tampering before execution. |
completedAt | string | number | Date | DateTime<boolean> | undefined | When the tool call completed. |
createdAt | string | number | Date | DateTime<boolean> | undefined | When this tool call was first created. |
fromArtifactTool? | boolean | false | true when this tool call originated from an @nhtio/adk!ArtifactTool invocation. Defaults to false. Remarks Set by the ADK's result-wrapping touch sites when ArtifactTool.isArtifactTool(tool) holds. Read by SpooledArtifact.forgeTools(ctx) when building each descriptor's callId enum — calls with this flag set are excluded so the model can't artifact_grep on a previous artifact_grep result. Optional in the raw shape (defaults to false); always defined on the constructed ToolCall. |
id | string | undefined | Stable unique identifier for this tool call; correlates the request with its result. |
inline? | boolean | true | When true (default), LLM adapters render this tool call's result inline — the full stringified body is wrapped in the adapter's trust envelope and sent to the model as the tool role content. When false, the adapter surfaces the result as a "handle" — a directions-bearing envelope that tells the model which forged artifact-query tools to call against this tc.id to read the content incrementally. Remarks Policy is the producer's or middleware's call: - A normal tool returns its result with inline: true by default so its output is shown verbatim. - Middleware that wants to keep large results out of the model's prompt sets inline: false (typically via ctx.mutateToolCall(tc.id, { inline: false })) before yielding. - LLM adapters do not override the flag, do not size-check the result, and do not silently switch to the handle pattern. For @nhtio/adk!Tokenizable results, the flag is effectively informational — handles only make sense for @nhtio/adk!SpooledArtifact (which is the only result kind the forged artifact-query tools can read). When inline: false is set on a call whose results is a Tokenizable, the adapter renders inline anyway and may log a warning. |
isComplete | boolean | undefined | true once the tool call has finished (successfully or not). |
isError | boolean | undefined | true when the tool execution produced an error; inspect results for detail. |
results | ToolCallResults | undefined | Result returned by the tool, or error detail when isError is true. Remarks Three silos with distinct render-time semantics — see ToolCallResults: - For a normal @nhtio/adk!Tool call whose handler returned string or Uint8Array, this is a @nhtio/adk!SpooledArtifact (or one of its subclasses) wrapping the spooled bytes. Tools that legitimately produce multiple bounded artifacts may return a SpooledArtifact[]. - For a Tool call whose handler returned a @nhtio/adk!Media or Media[], this is the same media handle(s) — the explicit-modality silo bypasses SpooledArtifact wrapping because the bytes are binary and rendered as provider-specific content blocks, not text. - For an @nhtio/adk!ArtifactTool call (a forged artifact-query tool), this is a @nhtio/adk!Tokenizable holding the raw model-visible answer — ArtifactTool explicitly opts out of wrapping to break the recursive grep-on-the-grep-result loop. The ADK sets RawToolCall.fromArtifactTool on calls produced by an ArtifactTool so subsequent forgeTools(ctx) invocations can filter them out of the callId enum. |
tool | string | undefined | Name of the tool the model has requested. |
updatedAt | string | number | Date | DateTime<boolean> | undefined | When this tool call was last modified. |