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

Function toolResult

integration/api/mcp_test.go:130–148  ·  view source on GitHub ↗
(t *testing.T, resp *mcp.CallToolResult)

Source from the content-addressed store, hash-verified

128}
129
130func toolResult(t *testing.T, resp *mcp.CallToolResult) string {
131 if resp.IsError {
132 t.Fatalf("tool call failed: %v", resp.Content)
133 }
134
135 var result strings.Builder
136
137 for _, content := range resp.Content {
138 // Handle different content types
139 switch c := content.(type) {
140 case mcp.TextContent:
141 result.WriteString(c.Text)
142 default:
143 t.Fatalf("unhandled content type: %T", c)
144 }
145 }
146
147 return result.String()
148}

Callers 1

assertTraceOverMCPFunction · 0.70

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected