MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getEnumLabels

Function getEnumLabels

src/utils/mcp/elicitationValidation.ts:117–125  ·  view source on GitHub ↗
(schema: EnumSchema)

Source from the content-addressed store, hash-verified

115 * Get enum display labels from EnumSchema
116 */
117export function getEnumLabels(schema: EnumSchema): string[] {
118 if ('oneOf' in schema) {
119 return schema.oneOf.map(item => item.title)
120 }
121 if ('enum' in schema) {
122 return ('enumNames' in schema ? schema.enumNames : undefined) ?? schema.enum
123 }
124 return []
125}
126
127/**
128 * Get label for a specific enum value

Callers 1

getEnumLabelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected