Skip to content
2 min read · 310 words

@nhtio/adk/forge

Schema-first tool construction, invocation records, artifact tools, and registries.

Remarks

The forge — where tools are made. Schema-first primitives consumers compose into a working tool surface: @nhtio/adk!Tool (the standard tool definition), @nhtio/adk!ArtifactTool (the artifact-bound variant for custom spooled-artifact query tools), @nhtio/adk!ToolCall (the persisted record of an invocation), and @nhtio/adk!ToolRegistry (the collection of tools available within a turn). These are almost always used together — a runner registers tools, the model emits tool calls, the executor invokes them via the registry, and the resulting record is persisted as a ToolCall.

Pairs with @nhtio/adk/batteries/tools, which ships ready-made tool instances built with this forge. The forge defines what a tool is; the batteries provide tools already made.

Classes

ClassDescription
ArtifactToolA @nhtio/adk!Tool subclass whose handler return value is wrapped directly in a @nhtio/adk!Tokenizable (not a @nhtio/adk!SpooledArtifact) when it lands on ToolCall.results.
ToolA tool definition that serves as the single source of truth for a callable tool: its name, description, input schema, execution handler, and the @nhtio/adk!SpooledArtifact subclass that wraps its serialised output.
ToolCallAn immutable, validated tool call record associated with a turn.
ToolRegistryA mutable, turn-scoped collection of @nhtio/adk!Tool instances.

Interfaces

InterfaceDescription
RawArtifactToolPlain input object supplied to ArtifactTool at construction time.
RawToolPlain input object supplied to Tool at construction time.
RawToolCallPlain input object supplied to ToolCall at construction time.

Type Aliases

Type AliasDescription
ArtifactToolHandlerThe execution function for an ArtifactTool.
SpooledArtifactConstructorConstructor signature for SpooledArtifact and any subclass.
ToolHandlerThe execution function for a Tool.