Skip to main content
Glama
mcp.go583 B
package utils import ( "fmt" "strings" ) // BuildMCPToolName 构建完整的工具名称 func BuildMCPToolName(toolName, serverName string) string { return fmt.Sprintf("%s@%s", toolName, serverName) } // ParseMCPToolName 从完整的工具名称中解析出服务器名称 func ParseMCPToolName(fullToolName string) (toolName, serverName string, err error) { lastIndex := strings.LastIndex(fullToolName, "@") if lastIndex == -1 { return "", "", fmt.Errorf("invalid tool name format: %s", fullToolName) } return fullToolName[:lastIndex], fullToolName[lastIndex+1:], 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/weibaohui/k8m'

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