getTextResult is a helper function that returns a text result from a tool call.
(t *testing.T, result *mcp.CallToolResult)
| 387 | |
| 388 | // getTextResult is a helper function that returns a text result from a tool call. |
| 389 | func getTextResult(t *testing.T, result *mcp.CallToolResult) *mcp.TextContent { |
| 390 | t.Helper() |
| 391 | assert.NotNil(t, result) |
| 392 | require.Len(t, result.Content, 1) |
| 393 | textContent, ok := result.Content[0].(*mcp.TextContent) |
| 394 | require.True(t, ok, "expected content to be of type TextContent") |
| 395 | return textContent |
| 396 | } |
| 397 | |
| 398 | func getErrorResult(t *testing.T, result *mcp.CallToolResult) *mcp.TextContent { |
| 399 | res := getTextResult(t, result) |
no outgoing calls
no test coverage detected