Skip to main content
Glama
region.go625 B
package util import ( "fmt" "regexp" "strings" ) const ENDPOINT_REGEX_PATTERN = `^(?:http[s]?:\/\/)?([a-z-0-9]+)\.(?:sls|log)\.aliyuncs\.com$` var regionSuffixs = []string{"-intranet", "-share", "-vpc"} func ParseRegion(endpoint string) (string, error) { var re = regexp.MustCompile(ENDPOINT_REGEX_PATTERN) groups := re.FindStringSubmatch(endpoint) if groups == nil { return "", fmt.Errorf("invalid endpoint format: %s", endpoint) } region := groups[1] for _, suffix := range regionSuffixs { if strings.HasSuffix(region, suffix) { return region[:len(region)-len(suffix)], nil } } return region, nil }

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/mozillazg/kube-audit-mcp'

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