FunctionSchema

public final class FunctionSchema


Defines the schema of parameters or responses for a tool.

Summary

Public constructors

FunctionSchema(
    @FunctionType int type,
    String description,
    Map<@NonNull String, @NonNull FunctionSchema> properties,
    List<@NonNull String> required,
    List<@NonNull String> enum,
    String format,
    Boolean nullable,
    FunctionSchema items,
    Long minItems,
    Long maxItems,
    Double minimum,
    Double maximum,
    Long minLength,
    Long maxLength,
    String pattern,
    List<@NonNull FunctionSchema> anyOf,
    String title,
    Long minProperties,
    Long maxProperties
)

Public methods

boolean
equals(Object other)
final List<@NonNull FunctionSchema>

optional list of subschemas that the value must validate against at least one of

final String

optional human-readable description of the schema used by the model

final List<@NonNull String>

optional list of allowed values for FunctionType.STRING or numeric types

final String

optional format of the data type (e.g., "float", "double", "int32", "int64")

final FunctionSchema

optional schema of items in an array for FunctionType.ARRAY type

final Long

optional maximum number of items for FunctionType.ARRAY type

final Long

optional maximum length for FunctionType.STRING type

final Long

optional maximum number of properties for FunctionType.OBJECT type

final Double

optional maximum value for numeric types

final Long

optional minimum number of items for FunctionType.ARRAY type

final Long

optional minimum length for FunctionType.STRING type

final Long

optional minimum number of properties for FunctionType.OBJECT type

final Double

optional minimum value for numeric types

final Boolean

optional boolean indicating whether the value may be null

final String

optional regex pattern that string values must match

final Map<@NonNull String, @NonNull FunctionSchema>

optional map of property names to their respective FunctionSchema definitions for FunctionType.OBJECT type

final List<@NonNull String>

optional list of property names that must be present for FunctionType.OBJECT type

final String

optional title for the schema

final int

the data type of the schema, must be one of the constants defined in FunctionType

int
@NonNull String

Public constructors

FunctionSchema

public FunctionSchema(
    @FunctionType int type,
    String description,
    Map<@NonNull String, @NonNull FunctionSchema> properties,
    List<@NonNull String> required,
    List<@NonNull String> enum,
    String format,
    Boolean nullable,
    FunctionSchema items,
    Long minItems,
    Long maxItems,
    Double minimum,
    Double maximum,
    Long minLength,
    Long maxLength,
    String pattern,
    List<@NonNull FunctionSchema> anyOf,
    String title,
    Long minProperties,
    Long maxProperties
)

Public methods

equals

public boolean equals(Object other)

getAnyOf

public final List<@NonNull FunctionSchema> getAnyOf()

optional list of subschemas that the value must validate against at least one of

getDescription

public final String getDescription()

optional human-readable description of the schema used by the model

getEnum

public final List<@NonNull String> getEnum()

optional list of allowed values for FunctionType.STRING or numeric types

getFormat

public final String getFormat()

optional format of the data type (e.g., "float", "double", "int32", "int64")

getItems

public final FunctionSchema getItems()

optional schema of items in an array for FunctionType.ARRAY type

getMaxItems

public final Long getMaxItems()

optional maximum number of items for FunctionType.ARRAY type

getMaxLength

public final Long getMaxLength()

optional maximum length for FunctionType.STRING type

getMaxProperties

public final Long getMaxProperties()

optional maximum number of properties for FunctionType.OBJECT type

getMaximum

public final Double getMaximum()

optional maximum value for numeric types

getMinItems

public final Long getMinItems()

optional minimum number of items for FunctionType.ARRAY type

getMinLength

public final Long getMinLength()

optional minimum length for FunctionType.STRING type

getMinProperties

public final Long getMinProperties()

optional minimum number of properties for FunctionType.OBJECT type

getMinimum

public final Double getMinimum()

optional minimum value for numeric types

getNullable

public final Boolean getNullable()

optional boolean indicating whether the value may be null

getPattern

public final String getPattern()

optional regex pattern that string values must match

getProperties

public final Map<@NonNull String, @NonNull FunctionSchema> getProperties()

optional map of property names to their respective FunctionSchema definitions for FunctionType.OBJECT type

getRequired

public final List<@NonNull String> getRequired()

optional list of property names that must be present for FunctionType.OBJECT type

getTitle

public final String getTitle()

optional title for the schema

getType

public final int getType()

the data type of the schema, must be one of the constants defined in FunctionType

hashCode

public int hashCode()

toString

public @NonNull String toString()