Skip to content

basalt / ai/src / toJsonSchema

Function: toJsonSchema() ​

> toJsonSchema(schema): Record<string, unknown>

Defined in: ai/src/schema/index.ts:269

Convert one of the exported zod schemas to JSON Schema (Draft 2020-12), for an out-of-process consumer to advertise as an MCP tool inputSchema/outputSchema.

Parameters ​

schema ​

ZodType

Returns ​

Record<string, unknown>

Released under the MIT License.