MCPcopy Index your code
hub / github.com/coder/coder / CallTool

Method CallTool

aibridge/mcp/server_proxy_manager.go:107–119  ·  view source on GitHub ↗

CallTool locates the proxier to which the requested tool is associated and delegates the tool call to it.

(ctx context.Context, name string, input any)

Source from the content-addressed store, hash-verified

105// CallTool locates the proxier to which the requested tool is associated and
106// delegates the tool call to it.
107func (s *ServerProxyManager) CallTool(ctx context.Context, name string, input any) (*mcp.CallToolResult, error) {
108 tool := s.GetTool(name)
109 if tool == nil {
110 return nil, xerrors.Errorf("%q tool not known", name)
111 }
112
113 proxy, ok := s.proxiers[tool.ServerName]
114 if !ok {
115 return nil, xerrors.Errorf("%q server not known", tool.ServerName)
116 }
117
118 return proxy.CallTool(ctx, name, input)
119}
120
121// Shutdown concurrently shuts down all known proxiers and waits for them *all* to complete.
122func (s *ServerProxyManager) Shutdown(ctx context.Context) error {

Callers

nothing calls this directly

Calls 3

GetToolMethod · 0.95
CallToolMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected