MCPcopy Create free account
hub / github.com/coder/coder / splitToolName

Function splitToolName

agent/x/agentmcp/manager.go:1034–1040  ·  view source on GitHub ↗

splitToolName extracts the server name and original tool name from a prefixed tool name like "server__tool".

(prefixed string)

Source from the content-addressed store, hash-verified

1032// splitToolName extracts the server name and original tool name
1033// from a prefixed tool name like "server__tool".
1034func splitToolName(prefixed string) (serverName, toolName string, err error) {
1035 server, tool, ok := strings.Cut(prefixed, ToolNameSep)
1036 if !ok || server == "" || tool == "" {
1037 return "", "", xerrors.Errorf("%w: expected format \"server%stool\", got %q", ErrInvalidToolName, ToolNameSep, prefixed)
1038 }
1039 return server, tool, nil
1040}
1041
1042// convertResult translates an MCP CallToolResult into a
1043// workspacesdk.CallMCPToolResponse. It iterates over content

Callers 2

TestSplitToolNameFunction · 0.85
CallToolMethod · 0.85

Calls 1

ErrorfMethod · 0.45

Tested by 1

TestSplitToolNameFunction · 0.68