Skip to main content

Module tool

Module tool 

Source
Expand description

Native, serializable data model for golem:tool/common@0.1.0 tool metadata.

A tool is a callable unit described by a single metadata record. The model is CLI-native (commands, subcommands, options, flags, positionals).

Types and values are not modeled here: every input/output type and every metadata-time value is expressed with the shared golem:core/types@2.0.0 schema model, exactly as the agent model does. A Tool owns a single SchemaGraph — the named-type registry shared by all of its commands — and each typed position embeds a recursive SchemaType; metadata-time defaults and value-is literals embed a recursive SchemaValue. The flattening into the WIT schema-graph / type-node-index / schema-value-tree wire form happens in wit.

The only tool-specific recursion site is the command tree: a flattened command hierarchy with the root at index 0 and children referenced by CommandIndex.

Producer-side construction invariants are checked by validation. The deterministic per-command input record shape shared by tool clients and tool implementations is defined by canonical.

Modules§

argv
Shared command-line parsing and help for schema-described tools.
canonical
Canonical input model for tool commands.
compatibility
Pure compiler for the directional value projections at a monomorphic middleware edge. Applying these plans, including disposal and stream relay, is a runtime responsibility.
constraints
validation
Producer-side construction invariants for the tool metadata model.
wit
Round-trip conversion between the recursive in-memory tool metadata model in super and the flat, index-based golem:tool/common@0.1.0 wire bindings re-exported here as wire.

Structs§

BoolFlagShape
CommandAnnotations
Behavioral hints surfaced to MCP and other LLM-facing surfaces, following the MCP convention.
CommandBody
CommandIndex
Index into CommandTree::nodes.
CommandNode
A node in the command tree. May dispatch to subcommands, run its own body, or both. Globals declared here apply to this command’s own body and to every descendant subcommand body.
CommandTree
Flattened command hierarchy. Always non-empty; the root command is at index 0.
Doc
ErrorCase
Example
FlagSpec
ForbidsC
Formatter
Globals
ImpliesC
MonomorphicToolMiddlewareScope
OptionSpec
Positional
Positionals
ProcessExitStatus
A completed command’s shell-visible status, distinct from a failure to execute the tool.
RefGroup
RepeatableListShape
RepeatableMapShape
ResultSpec
StreamSpec
TailPositional
Tool
Top-level tool metadata record.
ToolMiddleware
Metadata describing a tool middleware component.
ValueIsRef

Enums§

Constraint
DuplicateKeyPolicy
Resolution policy for a repeated key in a OptionShape::RepeatableMap.
ErrorKind
FlagShape
OptionShape
Quantifier
Ref
Repetition
ToolMiddlewareScope