Ruben Cagnie
04/06/2026, 2:43 PMMcpTool will not return a toolCallFailed when the "isError = false" (see MCP Spec)
Koog treats the result as-is, so isError: true is considered a "success"
I built a wrapper around this for my implementation, but wonder if this was a specific design decision?Ruben Cagnie
04/06/2026, 2:56 PM@Throws(McpToolExecutionException::class)
override suspend fun execute(args: JSONObject): CallToolResult {
val result = tool.execute(args)
if (result.isError == true) {
throw McpToolExecutionException(
result.content.filterIsInstance<TextContent>().joinToString("\n") { it.text }
.ifBlank { "MCP tool returned an error with no text content. (${result.content}" }
)
}
return result
}