MCPcopy Index your code
hub / github.com/docker/docker-agent / TestMCP_MultiAgent

Function TestMCP_MultiAgent

e2e/mcp_test.go:38–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

36}
37
38func TestMCP_MultiAgent(t *testing.T) {
39 t.Parallel()
40
41 ctx := t.Context()
42 agentSource, err := config.Resolve("testdata/multi.yaml", nil)
43 require.NoError(t, err)
44
45 _, runConfig := startRecordingAIProxy(t)
46 team, err := teamloader.Load(ctx, agentSource, runConfig, loaderdefaults.Opts()...)
47 require.NoError(t, err, "Failed to load team")
48 t.Cleanup(func() {
49 require.NoError(t, team.StopToolSets(ctx))
50 })
51
52 handler := mcp.CreateToolHandler(team, "web")
53 _, output, err := handler(ctx, nil, mcp.ToolInput{
54 Message: "Say hello in one sentence.",
55 })
56
57 require.NoError(t, err)
58 // Model response to "say hello" can vary, just check it contains a greeting
59 assert.Contains(t, output.Response, "Hello")
60}

Callers

nothing calls this directly

Calls 7

ResolveFunction · 0.92
LoadFunction · 0.92
CreateToolHandlerFunction · 0.92
startRecordingAIProxyFunction · 0.85
ContextMethod · 0.80
CleanupMethod · 0.65
StopToolSetsMethod · 0.65

Tested by

no test coverage detected