Skip to main content
Glama

Storyden

by Southclaws
validation.go994 B
package account import ( "context" "github.com/Southclaws/fault" "github.com/Southclaws/fault/fctx" "github.com/Southclaws/fault/fmsg" "github.com/Southclaws/fault/ftag" "github.com/Southclaws/storyden/app/resources/mark" ) var errInvalidHandle = fault.New("invalid handle") // ValidateHandle checks if a handle meets the requirements: // - Must be a valid slug (lowercase, letters, numbers, hyphens, underscores) // - Must be 30 characters or less func ValidateHandle(ctx context.Context, handle string) error { if !mark.IsSlug(handle) { return fault.Wrap( errInvalidHandle, fctx.With(ctx), ftag.With(ftag.InvalidArgument), fmsg.WithDesc("invalid handle format", "Handle must be lowercase letters, numbers, hyphens, and underscores only"), ) } if len(handle) > 30 { return fault.Wrap( errInvalidHandle, fctx.With(ctx), ftag.With(ftag.InvalidArgument), fmsg.WithDesc("handle too long", "Handle must be 30 characters or less"), ) } return nil }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Southclaws/storyden'

If you have feedback or need assistance with the MCP directory API, please join our Discord server