Documentation
¶
Overview ¶
Package toolwire states the invariant every provider adapter is held to: each tool a model is offered arrives on the wire with every argument it declares, with the required ones still required, and with each argument's own schema intact.
mast #154 shipped a release in which every tool reached Claude as a name with an empty schema; it passed two judged nightlies because nothing compared what the model was handed against what was declared. The comparison lives here, shared, so no adapter is held to a weaker check than its siblings. An adapter supplies one thing: a reader that pulls its own wire spelling out of a captured request body into a Wire.
Products keep the other half — the catalog captured from their own agent rigs, which cannot move here — and run it through the library's adapters with this Verify.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Summary ¶
Summary renders a catalog as one line per tool, so a failure says what was actually checked.
func Verify ¶
Verify compares what each declaration promised against what the adapter emitted, and returns one line per violation — empty when the conversion was faithful. Each check is a real outage, not a cosmetic mismatch:
- Every tool is on the wire. A tool never shown cannot be called.
- A tool with arguments arrives with a non-empty properties map (mast #154 exactly).
- Every argument name survives, and none is invented.
- Every required argument is still required; demoted, the model may omit it and the tool fails at dispatch.
- Each argument's own schema survives as a non-empty object.
Types ¶
type Entry ¶
type Entry struct {
// Name is the function name the model calls.
Name string
// Spelling records which declaration field carried the schema —
// "Parameters" (typed *genai.Schema), "ParametersJsonSchema", or
// "none". It names the converter branch in a failure.
Spelling string
// Rig names where the tool came from, so a failure says where to
// look.
Rig string
// Declaration is the genai declaration, verbatim.
Declaration *genai.FunctionDeclaration
// Props are the argument names the declaration advertises, sorted.
// Empty means the tool takes no arguments.
Props []string
// Required are the argument names marked required, sorted.
Required []string
}
Entry is one declared tool and the facts derived from its declaration.