MCPcopy
hub / github.com/claude-code-best/claude-code / getValidationTip

Function getValidationTip

src/utils/settings/validationTips.ts:140–164  ·  view source on GitHub ↗
(context: TipContext)

Source from the content-addressed store, hash-verified

138}
139
140export function getValidationTip(context: TipContext): ValidationTip | null {
141 const matcher = TIP_MATCHERS.find(m => m.matches(context))
142
143 if (!matcher) return null
144
145 const tip: ValidationTip = { ...matcher.tip }
146
147 if (
148 context.code === 'invalid_value' &&
149 context.enumValues &&
150 !tip.suggestion
151 ) {
152 tip.suggestion = `Valid values: ${context.enumValues.map(v => `"${v}"`).join(', ')}`
153 }
154
155 // Add documentation link based on path prefix
156 if (!tip.docLink && context.path) {
157 const pathPrefix = context.path.split('.')[0]
158 if (pathPrefix) {
159 tip.docLink = PATH_DOC_LINKS[pathPrefix]
160 }
161 }
162
163 return tip
164}

Callers 1

formatZodErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected