:wave: - we also noticed that the `McpTool` will n...
# koog-agentic-framework
r
👋 - we also noticed that the
McpTool
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?
My wrapper basically does the following:
Copy code
@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
}