schemaToToolDefinition
schemaToToolDefinition(
schema,name,description):ToolDefinition
Defined in: structured-output.ts:119
Convert a Zod schema to an OpenAI tool definition
Parameters
Section titled “Parameters”schema
Section titled “schema”any
Zod schema to convert
string = 'extract_data'
Function name for the tool
description
Section titled “description”string = 'Extract structured data from the input'
Description of what the tool does
Returns
Section titled “Returns”OpenAI-compatible tool definition