Skip to content
2 min read · 376 words

Interface: RawArtifactTool

Defined in: src/lib/classes/artifact_tool.ts:38

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 valueDescriptionDefined in
descriptionstringundefinedHuman-readable description passed to the model to explain what the tool does.src/lib/classes/artifact_tool.ts:42
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.src/lib/classes/artifact_tool.ts:58
handlerArtifactToolHandlerundefinedExecution function. Returns a string or @nhtio/adk!Tokenizable; the ADK wraps a bare string into a Tokenizable at the result-wrapping site.src/lib/classes/artifact_tool.ts:46
inputSchemaSchemaundefined@nhtio/validation schema for the tool's input arguments.src/lib/classes/artifact_tool.ts:44
meta?Record<string, unknown>undefinedOptional arbitrary metadata for this tool. Defaults to {}.src/lib/classes/artifact_tool.ts:48
namestringundefinedUnique identifier used in LLM tool definitions. Recommend lowercase snake_case.src/lib/classes/artifact_tool.ts:40
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.src/lib/classes/artifact_tool.ts:83
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.src/lib/classes/artifact_tool.ts:71