Skip to content
2 min read · 352 words

Interface: RawArtifactTool

Plain input object supplied to ArtifactTool at construction time.

Remarks

Mirrors the base RawTool except artifactConstructor is forbidden — an ArtifactTool emits a @nhtio/adk!Tokenizable directly into ToolCall.results and explicitly opts out of SpooledArtifact wrapping. The forbidden field is enforced by ArtifactTool.schema at construction time.

Properties

PropertyTypeDefault valueDescription
descriptionstringundefinedHuman-readable description passed to the model to explain what the tool does.
ephemeral?booleanfalseWhen true, marks this tool as owned by a specific @nhtio/adk!DispatchContext. Remarks ArtifactTool instances produced by SpooledArtifact.forgeTools(ctx) set this to true so that ToolRegistry.pruneEphemeral() drops them at ctx-completion.
handlerArtifactToolHandlerundefinedExecution function. Returns a string or @nhtio/adk!Tokenizable; the ADK wraps a bare string into a Tokenizable at the result-wrapping site.
inputSchemaSchemaundefined@nhtio/validation schema for the tool's input arguments.
meta?Record<string, unknown>undefinedOptional arbitrary metadata for this tool. Defaults to {}.
namestringundefinedUnique identifier used in LLM tool definitions. Recommend lowercase snake_case.
onCollision?"keep" | "replace" | "throw"'throw'Self-declared merge collision policy honoured by ToolRegistry.merge. Remarks Forged artifact-query tools set this to 'replace' so that merging multiple Subclass.forgeTools(ctx) outputs (whose base-method tools overlap by name) resolves silently — the descriptors, snapshot, and handler behaviour are interchangeable across subclasses, so replacement is a behavioural no-op.
trusted?booleanfalseWhen true, declares that this tool's output should be treated as trusted developer/user intent rather than as untrusted third-party text when surfaced to the model. Remarks Forged artifact-query tools default to false because their results are derived from spooled artifact bodies — which may themselves be untrusted upstream tool output. The trust signal does not promote handle-query results above the trust tier of the underlying artifact.