compileInputSchema
function compileInputSchema(schema: ZodType): JsonSchema;Compile a Zod schema to a JSON Schema object suitable for inputSchema.
The schema is emitted fully inline, so the result is a self-contained object
schema with no top-level $ref. A non-object root (e.g. z.string()) is
rejected — tool arguments are always a named-field object.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
schema | ZodType | The Zod schema for a tool’s arguments. |
Returns
Section titled “Returns”A JSON Schema object with type: 'object'.
Throws
Section titled “Throws”If the schema does not compile to an object schema.