MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / genPath

Function genPath

mcp-server/server.go:124–133  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

122}
123
124func genPath(path string) (sid string, err error) {
125 path = strings.TrimSuffix(path, "/")
126 ps := strings.Split(path, "/")
127 if len(ps) < 2 {
128 err = fmt.Errorf("invalid path: %s", path)
129 return
130 }
131 sid = ps[len(ps)-2]
132 return
133}
134
135func SetServer(sid string, name string, version string, tools ...ITool) {
136 ser, has := mcpServer.Get(sid)

Callers 1

ServeHTTPMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected