Interface: JSONSchema
@providerprotocol/ai / @providerprotocol/ai / JSONSchema
Interface: JSONSchema
Section titled “Interface: JSONSchema”Defined in: src/types/schema.ts:149
Root JSON Schema for tool parameters or structured outputs.
This is the top-level schema definition used when defining tool parameters or requesting structured output from an LLM.
Example
Section titled “Example”const weatherToolSchema: JSONSchema = { type: 'object', description: 'Parameters for getting weather information', properties: { location: { type: 'string', description: 'City name or coordinates' }, units: { type: 'string', enum: ['celsius', 'fahrenheit'], description: 'Temperature units' } }, required: ['location']};Properties
Section titled “Properties”additionalProperties?
Section titled “additionalProperties?”
optionaladditionalProperties:boolean
Defined in: src/types/schema.ts:160
Whether additional properties are allowed beyond those defined
description?
Section titled “description?”
optionaldescription:string
Defined in: src/types/schema.ts:163
Human-readable description of the schema’s purpose
properties
Section titled “properties”properties:
Record<string,JSONSchemaProperty>
Defined in: src/types/schema.ts:154
Property definitions for the object
required?
Section titled “required?”
optionalrequired:string[]
Defined in: src/types/schema.ts:157
List of required property names
type:
"object"
Defined in: src/types/schema.ts:151
Root schemas are always objects