MCPcopy
hub / github.com/grafana/tempo / assertTraceOverMCP

Function assertTraceOverMCP

integration/api/mcp_test.go:113–128  ·  view source on GitHub ↗
(t *testing.T, mcpClient mcpclient.MCPClient, traceID string)

Source from the content-addressed store, hash-verified

111}
112
113func assertTraceOverMCP(t *testing.T, mcpClient mcpclient.MCPClient, traceID string) {
114 resp, err := mcpClient.CallTool(context.Background(), mcp.CallToolRequest{
115 Params: mcp.CallToolParams{
116 Name: "get-trace",
117 Arguments: map[string]interface{}{"trace_id": traceID},
118 },
119 })
120 require.NoError(t, err)
121
122 str := toolResult(t, resp)
123
124 // the trace format is subject is to change so let's keep it simple.
125 if !strings.Contains(str, traceID) {
126 t.Fatalf("expected trace ID %s not found in response", traceID)
127 }
128}
129
130func toolResult(t *testing.T, resp *mcp.CallToolResult) string {
131 if resp.IsError {

Callers 1

TestMCPFunction · 0.85

Calls 1

toolResultFunction · 0.70

Tested by

no test coverage detected