Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/ModelContextProtocol/Server/AIFunctionMcpServerTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ public override async ValueTask<CallToolResponse> InvokeAsync(
{
AIContent aiContent => new()
{
Content = [aiContent.ToContent()]
Content = [aiContent.ToContent()],
IsError = aiContent is ErrorContent
},

null => new()
Expand All @@ -278,7 +279,8 @@ public override async ValueTask<CallToolResponse> InvokeAsync(

IEnumerable<AIContent> contentItems => new()
{
Content = [.. contentItems.Select(static item => item.ToContent())]
Content = [.. contentItems.Select(static item => item.ToContent())],
IsError = contentItems.Any(item => item is ErrorContent)
},

IEnumerable<Content> contents => new()
Expand Down