22 instantiations of McpServerToolResultContent
Microsoft.Extensions.AI.Abstractions (1)
Generated\361d1da7f942c932\JsonContext.McpServerToolResultContent.g.cs (1)
34ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.McpServerToolResultContent((string)args[0]),
Microsoft.Extensions.AI.Abstractions.Tests (8)
Contents\AIContentTests.cs (1)
80new McpServerToolResultContent("call123"),
Contents\McpServerToolResultContentTests.cs (5)
16McpServerToolResultContent c = new("callId"); 26McpServerToolResultContent c = new("callId"); 49Assert.Throws<ArgumentException>("callId", () => new McpServerToolResultContent(string.Empty)); 50Assert.Throws<ArgumentNullException>("callId", () => new McpServerToolResultContent(null!)); 56var content = new McpServerToolResultContent("call123")
Contents\ToolResultContentTests.cs (1)
56new McpServerToolResultContent("call2"),
Generated\361d1da7f942c932\TestJsonSerializerContext.McpServerToolResultContent.g.cs (1)
32ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.McpServerToolResultContent((string)args[0]),
Microsoft.Extensions.AI.Evaluation.Reporting (1)
Generated\361d1da7f942c932\JsonContext.McpServerToolResultContent.g.cs (1)
34ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.McpServerToolResultContent((string)args[0]),
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (1)
Generated\361d1da7f942c932\JsonContext.McpServerToolResultContent.g.cs (1)
34ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.McpServerToolResultContent((string)args[0]),
Microsoft.Extensions.AI.OpenAI (2)
OpenAIRealtimeClientSession.cs (1)
1199contents.Add(new McpServerToolResultContent(callId)
OpenAIResponsesChatClient.cs (1)
1851contents.Add(new McpServerToolResultContent(mtci.Id)
Microsoft.Extensions.AI.OpenAI.Tests (1)
OpenAIConversionTests.cs (1)
1490var mcpToolResult = new McpServerToolResultContent("call_123") { Outputs = isError ? [new ErrorContent("error")] : [new TextContent("sunny")] };
Microsoft.Extensions.AI.Stabilization.Tests (1)
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.McpServerToolResultContent.g.cs (1)
32ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.McpServerToolResultContent((string)args[0]),
Microsoft.Extensions.AI.Tests (7)
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (4)
1816new McpServerToolResultContent("callId2") { Outputs = [new TextContent("Result 2")] }, 1832new McpServerToolResultContent("callId2") { Outputs = [new TextContent("Result 2")] }, 1903[new McpServerToolResultContent("callId2") { Outputs = [new TextContent("Result 2")] }] : 1922[new McpServerToolResultContent("callId2") { Outputs = [new TextContent("Result 2")] }] :
ChatCompletion\OpenTelemetryChatClientTests.cs (2)
666new McpServerToolResultContent("mcp-call-1") { Outputs = [new TextContent("Tool result")] }, 691yield return new() { Contents = [new McpServerToolResultContent("mcp-call-1") { Outputs = [new TextContent("Tool result")] }] };
Generated\361d1da7f942c932\TestJsonSerializerContext.McpServerToolResultContent.g.cs (1)
32ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.McpServerToolResultContent((string)args[0]),
126 references to McpServerToolResultContent
Microsoft.Extensions.AI (2)
Common\OtelMessageSerializer.cs (1)
189case McpServerToolResultContent mstrc:
Realtime\OpenTelemetryRealtimeClientSession.cs (1)
609case McpServerToolResultContent mstrc:
Microsoft.Extensions.AI.Abstractions (18)
Contents\AIContent.cs (1)
28[JsonDerivedType(typeof(McpServerToolResultContent), typeDiscriminator: "mcpServerToolResult")]
Contents\McpServerToolResultContent.cs (1)
20/// Initializes a new instance of the <see cref="McpServerToolResultContent"/> class.
Contents\ToolResultContent.cs (1)
14[JsonDerivedType(typeof(McpServerToolResultContent), "mcpServerToolResult")]
Generated\361d1da7f942c932\JsonContext.McpServerToolResultContent.g.cs (14)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent>? _McpServerToolResultContent; 21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent> McpServerToolResultContent 24get => _McpServerToolResultContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent)); 27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent> Create_McpServerToolResultContent(global::System.Text.Json.JsonSerializerOptions options) 29if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.McpServerToolResultContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent> jsonTypeInfo)) 31var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.McpServerToolResultContent> 37ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string)}, modifiers: null), 41jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent>(options, objectInfo); 58DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent), 60Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolResultContent)obj).Outputs, 61Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.McpServerToolResultContent)obj).Outputs = value!, 68AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent).GetProperty("Outputs", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IList<global::Microsoft.Extensions.AI.AIContent>), global::System.Array.Empty<global::System.Type>(), null),
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.GetJsonTypeInfo.g.cs (1)
256if (type == typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent))
Microsoft.Extensions.AI.Abstractions.Tests (24)
Contents\McpServerToolResultContentTests.cs (9)
16McpServerToolResultContent c = new("callId"); 26McpServerToolResultContent c = new("callId"); 56var content = new McpServerToolResultContent("call123") 61AssertSerializationRoundtrips<McpServerToolResultContent>(content); 65static void AssertSerializationRoundtrips<T>(McpServerToolResultContent content) 72var deserializedContent = Assert.IsType<McpServerToolResultContent>(deserialized); 101var mcpResult = Assert.IsType<McpServerToolResultContent>(result);
Generated\361d1da7f942c932\TestJsonSerializerContext.GetJsonTypeInfo.g.cs (1)
266if (type == typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent))
Generated\361d1da7f942c932\TestJsonSerializerContext.McpServerToolResultContent.g.cs (14)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent>? _McpServerToolResultContent; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent> McpServerToolResultContent 22get => _McpServerToolResultContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent> Create_McpServerToolResultContent(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.McpServerToolResultContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent> jsonTypeInfo)) 29var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.McpServerToolResultContent> 35ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string)}, modifiers: null), 39jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent>(options, objectInfo); 56DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent), 58Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolResultContent)obj).Outputs, 59Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.McpServerToolResultContent)obj).Outputs = value!, 66AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent).GetProperty("Outputs", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IList<global::Microsoft.Extensions.AI.AIContent>), global::System.Array.Empty<global::System.Type>(), null),
Microsoft.Extensions.AI.Evaluation.Reporting (15)
Generated\361d1da7f942c932\JsonContext.McpServerToolResultContent.g.cs (14)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent>? _McpServerToolResultContent; 21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent> McpServerToolResultContent 24get => _McpServerToolResultContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent)); 27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent> Create_McpServerToolResultContent(global::System.Text.Json.JsonSerializerOptions options) 29if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.McpServerToolResultContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent> jsonTypeInfo)) 31var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.McpServerToolResultContent> 37ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string)}, modifiers: null), 41jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent>(options, objectInfo); 58DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent), 60Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolResultContent)obj).Outputs, 61Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.McpServerToolResultContent)obj).Outputs = value!, 68AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent).GetProperty("Outputs", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IList<global::Microsoft.Extensions.AI.AIContent>), global::System.Array.Empty<global::System.Type>(), null),
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.GetJsonTypeInfo.g.cs (1)
196if (type == typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent))
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (15)
Generated\361d1da7f942c932\JsonContext.McpServerToolResultContent.g.cs (14)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent>? _McpServerToolResultContent; 21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent> McpServerToolResultContent 24get => _McpServerToolResultContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent)); 27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent> Create_McpServerToolResultContent(global::System.Text.Json.JsonSerializerOptions options) 29if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.McpServerToolResultContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent> jsonTypeInfo)) 31var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.McpServerToolResultContent> 37ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string)}, modifiers: null), 41jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent>(options, objectInfo); 58DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent), 60Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolResultContent)obj).Outputs, 61Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.McpServerToolResultContent)obj).Outputs = value!, 68AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent).GetProperty("Outputs", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IList<global::Microsoft.Extensions.AI.AIContent>), global::System.Array.Empty<global::System.Type>(), null),
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.GetJsonTypeInfo.g.cs (1)
192if (type == typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent))
Microsoft.Extensions.AI.OpenAI (1)
OpenAIResponsesChatClient.cs (1)
1597case McpServerToolResultContent mstrc:
Microsoft.Extensions.AI.OpenAI.Tests (21)
OpenAIConversionTests.cs (5)
1032McpServerToolResultContent? mcpToolResultContent = updates[1].Contents.OfType<McpServerToolResultContent>().FirstOrDefault(); 1342McpServerToolResultContent? mcpToolResult = message.Contents.OfType<McpServerToolResultContent>().FirstOrDefault(c => c.CallId == "mcp_call_123"); 1490var mcpToolResult = new McpServerToolResultContent("call_123") { Outputs = isError ? [new ErrorContent("error")] : [new TextContent("sunny")] };
OpenAIResponseClientIntegrationTests.cs (4)
234Assert.NotEmpty(response.Messages.SelectMany(m => m.Contents).OfType<McpServerToolResultContent>()); 338Assert.NotEmpty(response.Messages.SelectMany(m => m.Contents).OfType<McpServerToolResultContent>()); 554var toolResult = Assert.Single(response.Messages.SelectMany(m => m.Contents).OfType<McpServerToolResultContent>());
OpenAIResponseClientTests.cs (12)
1642var result = Assert.IsType<McpServerToolResultContent>(message.Contents[1]); 2018var firstResult = Assert.IsType<McpServerToolResultContent>(message.Contents[2]); 2030var secondResult = Assert.IsType<McpServerToolResultContent>(message.Contents[4]); 2429var firstResult = Assert.IsType<McpServerToolResultContent>(message.Contents[2]); 2441var secondResult = Assert.IsType<McpServerToolResultContent>(message.Contents[4]); 2637var toolResult = Assert.IsType<McpServerToolResultContent>(message.Contents[2]);
Microsoft.Extensions.AI.Stabilization.Tests (15)
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.GetJsonTypeInfo.g.cs (1)
102if (type == typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent))
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.McpServerToolResultContent.g.cs (14)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent>? _McpServerToolResultContent; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent> McpServerToolResultContent 22get => _McpServerToolResultContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent> Create_McpServerToolResultContent(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.McpServerToolResultContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent> jsonTypeInfo)) 29var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.McpServerToolResultContent> 35ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string)}, modifiers: null), 39jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent>(options, objectInfo); 56DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent), 58Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolResultContent)obj).Outputs, 59Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.McpServerToolResultContent)obj).Outputs = value!, 66AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent).GetProperty("Outputs", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IList<global::Microsoft.Extensions.AI.AIContent>), global::System.Array.Empty<global::System.Type>(), null),
Microsoft.Extensions.AI.Tests (15)
Generated\361d1da7f942c932\TestJsonSerializerContext.GetJsonTypeInfo.g.cs (1)
178if (type == typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent))
Generated\361d1da7f942c932\TestJsonSerializerContext.McpServerToolResultContent.g.cs (14)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent>? _McpServerToolResultContent; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent> McpServerToolResultContent 22get => _McpServerToolResultContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent> Create_McpServerToolResultContent(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.McpServerToolResultContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent> jsonTypeInfo)) 29var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.McpServerToolResultContent> 35ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string)}, modifiers: null), 39jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.McpServerToolResultContent>(options, objectInfo); 56DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent), 58Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolResultContent)obj).Outputs, 59Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.McpServerToolResultContent)obj).Outputs = value!, 66AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolResultContent).GetProperty("Outputs", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IList<global::Microsoft.Extensions.AI.AIContent>), global::System.Array.Empty<global::System.Type>(), null),