MCPcopy Create free account
hub / github.com/codeaashu/claude-code / isEnumSchema

Function isEnumSchema

src/utils/mcp/elicitationValidation.ts:43–47  ·  view source on GitHub ↗
(
  schema: PrimitiveSchemaDefinition,
)

Source from the content-addressed store, hash-verified

41 * Check if schema is a single-select enum (either legacy `enum` format or new `oneOf` format)
42 */
43export const isEnumSchema = (
44 schema: PrimitiveSchemaDefinition,
45): schema is EnumSchema => {
46 return schema.type === 'string' && ('enum' in schema || 'oneOf' in schema)
47}
48
49/**
50 * Check if schema is a multi-select enum (`type: "array"` with `items.enum` or `items.anyOf`)

Callers 4

ElicitationFormDialogFunction · 0.85
handleNavigationFunction · 0.85
renderFormFieldsFunction · 0.85
getZodSchemaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected