Skip to content

Documentation / @agentick/mcp / validateFormSchemaFlatness

Function: validateFormSchemaFlatness()

validateFormSchemaFlatness(schema): string[]

Defined in: server/elicitation.ts:144

Walk a JSON Schema produced from a Zod object and verify it conforms to the spec's "flat object with primitive properties" rule. Returns an array of validation messages (empty on success).

Allowed at the property level:

  • string, number, integer, boolean primitives
  • String enum (single-select)
  • array whose items.type === "string" (with optional enum)

Disallowed:

  • Nested object types
  • array of non-primitive items
  • Discriminated unions, intersections, anyOf at the property level (other than the spec-defined oneOf+const+title labeled-enum form)

Parameters

schema

Record<string, unknown>

Returns

string[]

Released under the ISC License.