Interface: ToolMethodDescriptor
Defined in: lib/classes/spooled_artifact.ts:48
Metadata table entry for one of the artifact's existing query methods, used by SpooledArtifact.forgeTools to surface that method as an @nhtio/adk!ArtifactTool.
Remarks
This is a metadata shape, not a general method → tool pipeline. forgeTools knows how to marshal arguments for a fixed, closed set of method names (the base seven on SpooledArtifact and the JSON/Markdown methods on the bundled subclasses); a descriptor is the place to attach a tool name, description, args schema, and optional serializer to one of those methods. Adding a descriptor for a method whose name is not in that closed set will produce a tool whose handler invokes the method with no arguments.
For new methods that require custom argument marshalling, branching, multi-step logic, cross-artifact joins, or any other behaviour beyond "call this existing method," override SpooledArtifact.forgeTools and mint the @nhtio/adk!ArtifactTool directly — do not try to express it through a descriptor.
Zero-arg methods are the exception: a descriptor with no argsSchema (or one that adds only callId-adjacent fields you don't consume) works for any method that takes no arguments, regardless of name.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
argsSchema? | ObjectSchema<any> | Schema for the method's own args, NOT including callId. forgeTools() injects callId. | lib/classes/spooled_artifact.ts:56 |
description | string | Human-readable description passed to the model. Should mention "in this turn" so the model understands the artifact's lifecycle scope. | lib/classes/spooled_artifact.ts:54 |
method | string | Method to invoke on the resolved artifact instance (e.g. 'head', 'json_get'). | lib/classes/spooled_artifact.ts:52 |
name | string | Absolute tool name as exposed to the LLM (e.g. 'artifact_head'). | lib/classes/spooled_artifact.ts:50 |
serialise? | (result: unknown) => string | Optional formatter for non-string return values. Defaults: string → as-is; string[] → newline-join; number → String(n); otherwise JSON.stringify(value, null, 2). | lib/classes/spooled_artifact.ts:58 |