Skip to content

Commit 40a1b47

Browse files
authored
Merge pull request #229 from mqasimsarfraz/fix/empty-messages
Fix: Handle empty tool messages
2 parents 2673e2e + aa961f0 commit 40a1b47

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

pkg/tools/mcp/client.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,11 @@ func processMCPContent(toolResult *mcp.CallToolResult) *tools.ToolCallResult {
204204
}
205205
}
206206

207+
// Handle an empty response. This can happen if the MCP tool does not return any content.
208+
if finalContent == "" {
209+
finalContent = "no output"
210+
}
211+
207212
return &tools.ToolCallResult{
208213
Output: finalContent,
209214
}

0 commit comments

Comments
 (0)