925
}
926
if (params.item.type === 'mcpToolCall') {
928
>
const output = mcpToolOutput(params.item.result, params.item.error?.message) || entry.output;
929
>
const content = output ? [{ type: ToolResultContentType.Text as const, text: output }] : undefined;
930
>
return [{
931
>
type: ActionType.ChatToolCallComplete,
932
>
turnId: entry.turnId,
933
>
toolCallId: entry.toolCallId,
934
>
result: {
935
>
success,
936
>
pastTenseMessage: success ? `Called ${entry.toolName}` : `Failed to call ${entry.toolName}`,
937
>
content,
938
>
...(success ? {} : { error: { message: params.item.error?.message ?? `MCP tool ${params.item.status}`, ...(declined ? { code: 'denied' } : {}) } }),
939
>
},
940
>
}];
941
>
}
942
if (params.item.type === 'dynamicToolCall') {
943
const success = params.item.success === true || params.item.status === 'completed';