Skip to content

Documentation / @agentick/core / toJSONSchemaSync

Function: toJSONSchemaSync()

toJSONSchemaSync(schema, options?): Record<string, unknown>

Defined in: kernel/src/schema.ts:482

Synchronous version of toJSONSchema. Handles Zod 4 (via Standard JSON Schema interface), Standard JSON Schema, JSON Schema passthrough, and Zod 3 (via zod-to-json-schema if available synchronously — falls back to empty schema).

Use this when async dynamic import is not acceptable (e.g., MCP tool registration at server startup).

Parameters

schema

unknown

options?

ToJSONSchemaOptions = {}

Returns

Record<string, unknown>

Released under the ISC License.