(t *testing.T, resp *mcp.CallToolResult)
| 128 | } |
| 129 | |
| 130 | func 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 | } |
no test coverage detected