@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
| Class | Description |
|---|---|
| ArtifactTool | A @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. |
| Tool | A 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. |
| ToolCall | An immutable, validated tool call record associated with a turn. |
| ToolRegistry | A mutable, turn-scoped collection of @nhtio/adk!Tool instances. |
Interfaces
| Interface | Description |
|---|---|
| RawArtifactTool | Plain input object supplied to ArtifactTool at construction time. |
| RawTool | Plain input object supplied to Tool at construction time. |
| RawToolCall | Plain input object supplied to ToolCall at construction time. |
Type Aliases
| Type Alias | Description |
|---|---|
| ArtifactToolHandler | The execution function for an ArtifactTool. |
| SpooledArtifactConstructor | Constructor signature for SpooledArtifact and any subclass. |
| ToolHandler | The execution function for a Tool. |