# FunctionSchema

# FunctionSchema


```
public final class FunctionSchema
```

<br />

*** ** * ** ***

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>` | `getAnyOf()` optional list of subschemas that the value must validate against at least one of |
| `final String` | `getDescription()` optional human-readable description of the schema used by the model |
| `final List<@NonNull String>` | `getEnum()` optional list of allowed values for `FunctionType.STRING` or numeric types |
| `final String` | `getFormat()` optional format of the data type (e.g., "float", "double", "int32", "int64") |
| `final FunctionSchema` | `getItems()` optional schema of items in an array for `FunctionType.ARRAY` type |
| `final Long` | `getMaxItems()` optional maximum number of items for `FunctionType.ARRAY` type |
| `final Long` | `getMaxLength()` optional maximum length for `FunctionType.STRING` type |
| `final Long` | `getMaxProperties()` optional maximum number of properties for `FunctionType.OBJECT` type |
| `final Double` | `getMaximum()` optional maximum value for numeric types |
| `final Long` | `getMinItems()` optional minimum number of items for `FunctionType.ARRAY` type |
| `final Long` | `getMinLength()` optional minimum length for `FunctionType.STRING` type |
| `final Long` | `getMinProperties()` optional minimum number of properties for `FunctionType.OBJECT` type |
| `final Double` | `getMinimum()` optional minimum value for numeric types |
| `final Boolean` | `getNullable()` optional boolean indicating whether the value may be null |
| `final String` | `getPattern()` optional regex pattern that string values must match |
| `final Map<@NonNull String, @NonNull FunctionSchema>` | `getProperties()` optional map of property names to their respective `FunctionSchema` definitions for `FunctionType.OBJECT` type |
| `final List<@NonNull String>` | `getRequired()` optional list of property names that must be present for `FunctionType.OBJECT` type |
| `final String` | `getTitle()` optional title for the schema |
| `final int` | `getType()` the data type of the schema, must be one of the constants defined in `FunctionType` |
| `int` | `hashCode()` |
| `@NonNull String` | `toString()` |

## 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()
```