ESM
import { createSchema } from "@arcgis/ai-components/agent-utils/createSchema.js";

Functions

createSchema

Function
Since
ArcGIS Maps SDK for JavaScript 5.2

Creates a Zod schema from a JSON Schema-style object definition. Supports string, number, boolean, array, and nested object fields.

Use the returned schema for the inputSchema or outputSchema of a FunctionAgent, LLMAgent, or WorkflowAgent. You can also use it for the inputSchema or outputSchema of a FunctionTool that an LLMAgent or SkillAgent can invoke.

This helper supports only a subset of JSON Schema-style definitions. For schema features outside this subset, define the schema directly with Zod.

See also
Signature
createSchema (definition: SchemaDefinition): Promise<z.ZodObject>

Parameters

ParameterTypeDescriptionRequired
definition
Returns
Promise<z.ZodObject>