Skip to main content
The schema-driven form renderer and the JSON Schema helpers it is built on.

CompletionProvider

Fetch argument-value suggestions for a string field. argName is the field’s path within the form (a property key at the root, a dotted path when nested); partial is the value typed so far. The caller owns the source (e.g. an MCP completion/complete call) — SchemaForm only routes string fields through the completion-backed input when a provider is supplied.

Discriminator

A Pydantic-style discriminated-union tag: which property selects the variant. Properties

JsonSchema

A structural JSON Schema node. All keys optional; the index signature keeps the type permissive so an unrecognized keyword is never a type error — it is a runtime classification concern the renderer handles. Properties Related: Discriminator, JsonSchemaType

JsonSchemaType

The JSON-Schema type keyword values Pydantic emits.

SchemaForm

Render a controlled form for schema. The root is usually an object (a tool’s input schema); a scalar/array/union root renders as a single field group. Props Related: SchemaFormProps

SchemaFormErrors

A structured, per-path bag of validation problems. Keys are dotted/bracketed paths from the form root ("" = the root value, "user.name", "tags[0]"); each entry is a loud, human-readable message. Empty object = valid.

SchemaFormProps

Properties Related: CompletionProvider, JsonSchema

defaultValueForSchema

The initial value for a schema. root carries the $defs document for $ref resolution and defaults to the schema itself (the common whole-tool-schema call). Parameters Related: JsonSchema

resolveRef

Resolve an internal $ref against the document root, following chained refs (a $ref whose target is itself a $ref). Only same-document pointers are supported (#/$defs/Name, #/definitions/Name, #); an external or unresolvable ref throws LOUDLY rather than yielding a silent empty schema. A schema with no $ref is returned unchanged. A pointer cycle throws. Parameters Related: JsonSchema

validateAgainstSchema

Validate value against schema, returning a per-path error bag (empty = valid). The caller runs this before submit and feeds the result back to SchemaForm for display. options.maxUploadBytes mirrors the renderer’s maxUploadBytes prop so a media field’s byte cap is enforced identically here. Parameters Related: JsonSchema, SchemaFormErrors