| 111 | } |
| 112 | |
| 113 | func 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 | |
| 130 | func toolResult(t *testing.T, resp *mcp.CallToolResult) string { |
| 131 | if resp.IsError { |