Overview
Allternit supports strict tool schemas — a mode where the LLM provider validates tool arguments against the declared JSON Schema before the tool is executed. Arguments outside the schema are rejected at the provider level, preventing malformed inputs from reaching your tool’sexecute function.
Enabling strict mode
Strict mode is enabled per-tool at registration:NativeToolBelt are registered with strict: true by default.
What strict mode enforces
Schema requirements
For strict mode to work with provider-level validation, your schema must:- Declare
type: "object"at the root. - List all properties explicitly in
properties. - Include a
requiredarray listing all mandatory fields. - Not use
$ref,oneOf,anyOf, orallOfat the top level (provider limitation).
Error handling
When strict validation fails, the provider returns an error before your tool is called. The harness surfaces this as a tool error:When to use strict mode
- Use strict mode for tools with well-defined, stable schemas — especially tools exposed to external models or MCP clients.
- Skip strict mode for tools that accept freeform input or that need to evolve their schema without versioning.