Overview

Allternit supports strict tool schemas. When a tool is registered with strict: true, the registry rewrites its input_schema so every object schema is closed (additionalProperties: false), recursively through properties and items. That closed schema is what is sent to providers that require strict tools, and it is what registry.validateInput() checks arguments against. Source: sdk/allternit-sdk/src/ai-runtime/tools/schema.ts and registry.ts. Whether a given model provider also enforces the schema on its side depends on that provider; the registry does not add provider-side checks.

Enabling strict mode

Strict mode is enabled per tool at registration:
The NativeToolBelt tools and MCP tools registered through the SDK are registered with strict: true.

What validation enforces

validateInput uses a small built-in validator for the JSON Schema subset tools use: validateInput returns { valid, errors }; it does not throw on invalid input (it throws only when the tool is not registered).

Schema guidance

  1. Declare type: "object" at the root.
  2. List every property in properties.
  3. Include a required array for mandatory fields.
  4. Avoid $ref, oneOf, anyOf and allOf at the top level; the built-in validator does not evaluate them and some providers reject them.

When to use strict mode

  • Use strict mode for tools with stable schemas, especially tools exposed to external models or MCP clients.
  • Skip strict mode for tools that accept freeform input or need to evolve their schema without versioning.