MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / validateSlug

Function validateSlug

internal/httpapi/agents_write.go:53–64  ·  view source on GitHub ↗
(slug string)

Source from the content-addressed store, hash-verified

51}
52
53func validateSlug(slug string) error {
54 if len(slug) < 2 || len(slug) > 40 {
55 return errSlug("slug must be 2–40 characters")
56 }
57 if !slugPattern.MatchString(slug) {
58 return errSlug("slug must be lowercase alphanumeric with hyphens, no leading/trailing hyphens")
59 }
60 if reservedSlugs[slug] {
61 return errSlug("slug is reserved")
62 }
63 return nil
64}
65
66func errSlug(msg string) error { return &slugError{msg} }
67

Callers 1

handleCreateAgentMethod · 0.70

Calls 1

errSlugFunction · 0.85

Tested by

no test coverage detected