Builds JSON Schema 2020-12 from arg declarations and validates arguments
against it.
The validator covers what the declarations emit: object properties,
required, additionalProperties, the primitive types, enum, arrays of
one type, minimum/maximum, minLength/maxLength, pattern, and
default. It never fetches a $ref.
Summary
Functions
Header name → property path for every x-mcp-header reachable through properties only.
Validates input (string or atom keys) against schema. Returns the
arguments with atom keys for declared properties (undeclared properties
keep their string keys when the schema allows them, so client input never
creates atoms), defaults applied, and nil for absent optional properties.
Types
Functions
Header name → property path for every x-mcp-header reachable through properties only.
@spec validate(map(), map()) :: {:ok, map()} | {:error, [%{path: [String.t()], message: String.t()}]}
Validates input (string or atom keys) against schema. Returns the
arguments with atom keys for declared properties (undeclared properties
keep their string keys when the schema allows them, so client input never
creates atoms), defaults applied, and nil for absent optional properties.