MCPcopy Index your code
hub / github.com/modelcontextprotocol/registry / validateTitle

Function validateTitle

internal/validators/validators.go:215–235  ·  view source on GitHub ↗
(ctx *ValidationContext, title string)

Source from the content-addressed store, hash-verified

213}
214
215func validateTitle(ctx *ValidationContext, title string) *ValidationResult {
216 result := &ValidationResult{Valid: true, Issues: []ValidationIssue{}}
217
218 // Skip validation if title is not provided (optional field)
219 if title == "" {
220 return result
221 }
222
223 // Check that title is not only whitespace
224 if strings.TrimSpace(title) == "" {
225 issue := NewValidationIssueFromError(
226 ValidationIssueTypeSemantic,
227 ctx.String(),
228 fmt.Errorf("title cannot be only whitespace"),
229 "title-whitespace-only",
230 )
231 result.AddIssue(issue)
232 }
233
234 return result
235}
236
237func validateIcons(ctx *ValidationContext, icons []model.Icon) *ValidationResult {
238 result := &ValidationResult{Valid: true, Issues: []ValidationIssue{}}

Callers 1

ValidateServerJSONFunction · 0.85

Calls 3

AddIssueMethod · 0.95
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…