diff --git a/crates/goose/src/providers/formats/bedrock.rs b/crates/goose/src/providers/formats/bedrock.rs index bff8ff33c61d..c05279959a9e 100644 --- a/crates/goose/src/providers/formats/bedrock.rs +++ b/crates/goose/src/providers/formats/bedrock.rs @@ -97,12 +97,18 @@ pub fn to_bedrock_message_content(content: &MessageContent) -> Result>()?, ), - Err(_) => None, + Err(error) => { + // For errors, create a text content block with the error message + Some(vec![bedrock::ToolResultContentBlock::Text(format!( + "The tool call returned the following error:\n{}", + error + ))]) + } }; bedrock::ContentBlock::ToolResult( bedrock::ToolResultBlock::builder() .tool_use_id(tool_res.id.to_string()) - .status(if content.is_some() { + .status(if tool_res.tool_result.is_ok() { bedrock::ToolResultStatus::Success } else { bedrock::ToolResultStatus::Error