42 instantiations of McpServerToolCallContent
Microsoft.Extensions.AI.Abstractions (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.McpServerToolCallContent.g.cs (1)
34ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.McpServerToolCallContent((string)args[0], (string)args[1], (string)args[2]),
Microsoft.Extensions.AI.Abstractions.Tests (16)
Contents\AIContentTests.cs (3)
79new McpServerToolCallContent("call123", "myTool", "myServer"), 81new ToolApprovalRequestContent("request123", new McpServerToolCallContent("call123", "myTool", "myServer")), 82new ToolApprovalResponseContent("request123", approved: true, new McpServerToolCallContent("call456", "myTool2", "myServer2")),
Contents\InputRequestContentTests.cs (1)
41new ToolApprovalRequestContent("request456", new McpServerToolCallContent("call456", "myTool", "myServer")),
Contents\InputResponseContentTests.cs (1)
40new ToolApprovalResponseContent("request456", true, new McpServerToolCallContent("call456", "myTool", "myServer")),
Contents\McpServerToolCallContentTests.cs (7)
16McpServerToolCallContent c = new("callId1", "toolName", null); 30McpServerToolCallContent c = new("callId1", "toolName", "serverName"); 55Assert.Throws<ArgumentException>("callId", () => new McpServerToolCallContent(string.Empty, "name", null)); 56Assert.Throws<ArgumentException>("name", () => new McpServerToolCallContent("callId1", string.Empty, null)); 58Assert.Throws<ArgumentNullException>("callId", () => new McpServerToolCallContent(null!, "name", null)); 59Assert.Throws<ArgumentNullException>("name", () => new McpServerToolCallContent("callId1", null!, null)); 65var content = new McpServerToolCallContent("call123", "myTool", "myServer")
Contents\ToolApprovalRequestContentTests.cs (1)
25new McpServerToolCallContent("MCC1", "TestTool", "TestServer") { Arguments = new Dictionary<string, object?> { { "arg1", "value1" } } },
Contents\ToolApprovalResponseContentTests.cs (1)
25new McpServerToolCallContent("MCC1", "TestTool", "TestServer") { Arguments = new Dictionary<string, object?> { { "arg1", "value1" } } },
Contents\ToolCallContentTests.cs (1)
57new McpServerToolCallContent("call2", "myTool", "myServer"),
Generated\361d1da7f942c932\TestJsonSerializerContext.McpServerToolCallContent.g.cs (1)
32ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.McpServerToolCallContent((string)args[0], (string)args[1], (string)args[2]),
Microsoft.Extensions.AI.Evaluation.Reporting (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.McpServerToolCallContent.g.cs (1)
34ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.McpServerToolCallContent((string)args[0], (string)args[1], (string)args[2]),
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.McpServerToolCallContent.g.cs (1)
34ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.McpServerToolCallContent((string)args[0], (string)args[1], (string)args[2]),
Microsoft.Extensions.AI.OpenAI (6)
OpenAIRealtimeClientSession.cs (3)
1186new McpServerToolCallContent(callId, mcpItem.ToolName ?? string.Empty, mcpItem.ServerLabel) 1223var toolCall = new McpServerToolCallContent(approvalId, approvalItem.ToolName ?? string.Empty, approvalItem.ServerLabel) 1241contents.Add(new McpServerToolCallContent(toolDef.Name, toolDef.Name, toolListItem.ServerLabel)
OpenAIResponsesChatClient.cs (3)
226var approvalRequest = new ToolApprovalRequestContent(mtcari.Id, new McpServerToolCallContent(mtcari.Id, mtcari.ToolName, mtcari.ServerLabel) 529var streamApprovalRequest = new ToolApprovalRequestContent(mtcari.Id, new McpServerToolCallContent(mtcari.Id, mtcari.ToolName, mtcari.ServerLabel) 1842contents.Add(new McpServerToolCallContent(mtci.Id, mtci.ToolName, mtci.ServerLabel)
Microsoft.Extensions.AI.OpenAI.Tests (1)
OpenAIConversionTests.cs (1)
1489var mcpToolCall = new McpServerToolCallContent("call_123", "get_weather", "weather_server") { Arguments = new Dictionary<string, object?> { ["city"] = "Seattle" } };
Microsoft.Extensions.AI.Stabilization.Tests (1)
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.McpServerToolCallContent.g.cs (1)
32ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.McpServerToolCallContent((string)args[0], (string)args[1], (string)args[2]),
Microsoft.Extensions.AI.Tests (15)
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (11)
1744new ToolApprovalRequestContent("callId2", new McpServerToolCallContent("callId2", "McpCall", "myServer")) 1753new ToolApprovalRequestContent("callId2", new McpServerToolCallContent("callId2", "McpCall", "myServer")) 1783new ToolApprovalRequestContent("callId2", new McpServerToolCallContent("callId2", "McpCall", "myServer")) 1788new ToolApprovalResponseContent("callId2", true, new McpServerToolCallContent("callId2", "McpCall", "myServer")) 1797new ToolApprovalRequestContent("callId2", new McpServerToolCallContent("callId2", "McpCall", "myServer")) 1809new ToolApprovalResponseContent("callId2", true, new McpServerToolCallContent("callId2", "McpCall", "myServer")) 1867new ToolApprovalRequestContent("callId2", new McpServerToolCallContent("callId2", "McpCall", "myServer")) 1872new ToolApprovalResponseContent("callId2", approveMcpCall, new McpServerToolCallContent("callId2", "McpCall", "myServer")) 1880new ToolApprovalRequestContent("callId2", new McpServerToolCallContent("callId2", "McpCall", "myServer")) 1894new ToolApprovalResponseContent("callId2", approveMcpCall, new McpServerToolCallContent("callId2", "McpCall", "myServer")) 2094McpServerToolCallContent mstcc => new McpServerToolCallContent(mstcc.CallId, mstcc.Name, mstcc.ServerName)
ChatCompletion\OpenTelemetryChatClientTests.cs (3)
665new McpServerToolCallContent("mcp-call-1", "myTool", "myServer") { Arguments = new Dictionary<string, object?> { ["param1"] = "value1" } }, 690yield return new() { Contents = [new McpServerToolCallContent("mcp-call-1", "myTool", "myServer") { Arguments = new Dictionary<string, object?> { ["param1"] = "value1" } }] }; 836var toolCall = new McpServerToolCallContent("mcp-call-2", "dangerousTool", "secureServer")
Generated\361d1da7f942c932\TestJsonSerializerContext.McpServerToolCallContent.g.cs (1)
32ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.McpServerToolCallContent((string)args[0], (string)args[1], (string)args[2]),
188 references to McpServerToolCallContent
Microsoft.Extensions.AI (4)
Common\OtelMessageSerializer.cs (3)
176case McpServerToolCallContent mstcc: 200case ToolApprovalRequestContent fareqc when fareqc.ToolCall is McpServerToolCallContent mcpToolCall: 213case ToolApprovalResponseContent farespc when farespc.ToolCall is McpServerToolCallContent:
Realtime\OpenTelemetryRealtimeClientSession.cs (1)
596case McpServerToolCallContent mstcc:
Microsoft.Extensions.AI.Abstractions (24)
Contents\AIContent.cs (1)
27[JsonDerivedType(typeof(McpServerToolCallContent), typeDiscriminator: "mcpServerToolCall")]
Contents\McpServerToolCallContent.cs (1)
23/// Initializes a new instance of the <see cref="McpServerToolCallContent"/> class.
Contents\ToolCallContent.cs (1)
14[JsonDerivedType(typeof(McpServerToolCallContent), "mcpServerToolCall")]
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.GetJsonTypeInfo.g.cs (1)
252if (type == typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent))
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.McpServerToolCallContent.g.cs (20)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent>? _McpServerToolCallContent; 21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent> McpServerToolCallContent 24get => _McpServerToolCallContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent)); 27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent> Create_McpServerToolCallContent(global::System.Text.Json.JsonSerializerOptions options) 29if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.McpServerToolCallContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent> jsonTypeInfo)) 31var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.McpServerToolCallContent> 37ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(string), typeof(string)}, modifiers: null), 41jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent>(options, objectInfo); 58DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent), 60Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).Name, 68AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetProperty("Name", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 79DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent), 81Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).ServerName, 89AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetProperty("ServerName", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 99DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent), 101Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).Arguments, 102Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).Arguments = value!, 109AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetProperty("Arguments", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IDictionary<string, object>), global::System.Array.Empty<global::System.Type>(), null),
Microsoft.Extensions.AI.Abstractions.Tests (32)
AssertExtensions.cs (2)
80McpServerToolCallContent mcp => (mcp.Name, mcp.Arguments), 87McpServerToolCallContent mcp => (mcp.Name, mcp.Arguments),
Contents\McpServerToolCallContentTests.cs (9)
16McpServerToolCallContent c = new("callId1", "toolName", null); 30McpServerToolCallContent c = new("callId1", "toolName", "serverName"); 65var content = new McpServerToolCallContent("call123", "myTool", "myServer") 70AssertSerializationRoundtrips<McpServerToolCallContent>(content); 74static void AssertSerializationRoundtrips<T>(McpServerToolCallContent content) 81var deserializedContent = Assert.IsType<McpServerToolCallContent>(deserialized); 111var mcpCall = Assert.IsType<McpServerToolCallContent>(result);
Generated\361d1da7f942c932\TestJsonSerializerContext.GetJsonTypeInfo.g.cs (1)
262if (type == typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent))
Generated\361d1da7f942c932\TestJsonSerializerContext.McpServerToolCallContent.g.cs (20)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent>? _McpServerToolCallContent; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent> McpServerToolCallContent 22get => _McpServerToolCallContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent> Create_McpServerToolCallContent(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.McpServerToolCallContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent> jsonTypeInfo)) 29var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.McpServerToolCallContent> 35ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(string), typeof(string)}, modifiers: null), 39jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent>(options, objectInfo); 56DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent), 58Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).Name, 66AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetProperty("Name", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 77DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent), 79Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).ServerName, 87AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetProperty("ServerName", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 97DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent), 99Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).Arguments, 100Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).Arguments = value!, 107AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetProperty("Arguments", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IDictionary<string, object>), global::System.Array.Empty<global::System.Type>(), null),
Microsoft.Extensions.AI.Evaluation.Reporting (21)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.GetJsonTypeInfo.g.cs (1)
192if (type == typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent))
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.McpServerToolCallContent.g.cs (20)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent>? _McpServerToolCallContent; 21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent> McpServerToolCallContent 24get => _McpServerToolCallContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent)); 27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent> Create_McpServerToolCallContent(global::System.Text.Json.JsonSerializerOptions options) 29if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.McpServerToolCallContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent> jsonTypeInfo)) 31var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.McpServerToolCallContent> 37ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(string), typeof(string)}, modifiers: null), 41jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent>(options, objectInfo); 58DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent), 60Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).Name, 68AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetProperty("Name", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 79DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent), 81Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).ServerName, 89AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetProperty("ServerName", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 99DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent), 101Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).Arguments, 102Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).Arguments = value!, 109AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetProperty("Arguments", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IDictionary<string, object>), global::System.Array.Empty<global::System.Type>(), null),
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (21)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.GetJsonTypeInfo.g.cs (1)
188if (type == typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent))
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.McpServerToolCallContent.g.cs (20)
15private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent>? _McpServerToolCallContent; 21public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent> McpServerToolCallContent 24get => _McpServerToolCallContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent)); 27private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent> Create_McpServerToolCallContent(global::System.Text.Json.JsonSerializerOptions options) 29if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.McpServerToolCallContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent> jsonTypeInfo)) 31var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.McpServerToolCallContent> 37ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(string), typeof(string)}, modifiers: null), 41jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent>(options, objectInfo); 58DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent), 60Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).Name, 68AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetProperty("Name", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 79DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent), 81Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).ServerName, 89AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetProperty("ServerName", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 99DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent), 101Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).Arguments, 102Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).Arguments = value!, 109AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetProperty("Arguments", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IDictionary<string, object>), global::System.Array.Empty<global::System.Type>(), null),
Microsoft.Extensions.AI.OpenAI (7)
OpenAIRealtimeClientSession.cs (1)
1223var toolCall = new McpServerToolCallContent(approvalId, approvalItem.ToolName ?? string.Empty, approvalItem.ServerLabel)
OpenAIResponsesChatClient.cs (6)
1287Dictionary<string, McpServerToolCallContent>? idToContentMapping = null; 1320ToolApprovalResponseContent { ToolCall: McpServerToolCallContent } toolResp => ResponseItem.CreateMcpApprovalResponseItem(toolResp.RequestId, toolResp.Approved), 1410case ToolApprovalResponseContent toolResp when toolResp.ToolCall is McpServerToolCallContent: 1574case McpServerToolCallContent mstcc: 1587case ToolApprovalRequestContent toolReq when toolReq.ToolCall is McpServerToolCallContent mcpToolCall: 1598if (idToContentMapping?.TryGetValue(mstrc.CallId, out McpServerToolCallContent? associatedCall) is true)
Microsoft.Extensions.AI.OpenAI.Tests (33)
OpenAIConversionTests.cs (13)
1025McpServerToolCallContent? mcpToolCallContent = updates[1].Contents.OfType<McpServerToolCallContent>().FirstOrDefault(); 1045McpServerToolCallContent nestedMcpCall = Assert.IsType<McpServerToolCallContent>(approvalRequest.ToolCall); 1058McpServerToolCallContent correlatedMcpCall = Assert.IsType<McpServerToolCallContent>(approvalResponse.ToolCall); 1335McpServerToolCallContent? mcpToolCall = message.Contents.OfType<McpServerToolCallContent>().FirstOrDefault(c => c.CallId == "mcp_call_123"); 1356McpServerToolCallContent nestedMcpCall = Assert.IsType<McpServerToolCallContent>(approvalRequestContent.ToolCall); 1371McpServerToolCallContent correlatedMcpCall = Assert.IsType<McpServerToolCallContent>(approvalResponseContent.ToolCall); 1489var mcpToolCall = new McpServerToolCallContent("call_123", "get_weather", "weather_server") { Arguments = new Dictionary<string, object?> { ["city"] = "Seattle" } };
OpenAIResponseClientIntegrationTests.cs (6)
233Assert.NotEmpty(response.Messages.SelectMany(m => m.Contents).OfType<McpServerToolCallContent>()); 337Assert.NotEmpty(response.Messages.SelectMany(m => m.Contents).OfType<McpServerToolCallContent>()); 541var mcpCallContent = Assert.IsType<McpServerToolCallContent>(approvalRequest.ToolCall); 551var toolCall = Assert.Single(response.Messages.SelectMany(m => m.Contents).OfType<McpServerToolCallContent>());
OpenAIResponseClientTests.cs (12)
1633var call = Assert.IsType<McpServerToolCallContent>(message.Contents[0]); 2010var firstCall = Assert.IsType<McpServerToolCallContent>(message.Contents[1]); 2022var secondCall = Assert.IsType<McpServerToolCallContent>(message.Contents[3]); 2421var firstCall = Assert.IsType<McpServerToolCallContent>(message.Contents[1]); 2433var secondCall = Assert.IsType<McpServerToolCallContent>(message.Contents[3]); 2630var toolCall = Assert.IsType<McpServerToolCallContent>(message.Contents[1]);
parent\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (2)
80McpServerToolCallContent mcp => (mcp.Name, mcp.Arguments), 87McpServerToolCallContent mcp => (mcp.Name, mcp.Arguments),
Microsoft.Extensions.AI.Stabilization.Tests (21)
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.GetJsonTypeInfo.g.cs (1)
98if (type == typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent))
Generated\361d1da7f942c932\AIContentSerializationRegressionContext.McpServerToolCallContent.g.cs (20)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent>? _McpServerToolCallContent; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent> McpServerToolCallContent 22get => _McpServerToolCallContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent> Create_McpServerToolCallContent(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.McpServerToolCallContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent> jsonTypeInfo)) 29var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.McpServerToolCallContent> 35ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(string), typeof(string)}, modifiers: null), 39jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent>(options, objectInfo); 56DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent), 58Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).Name, 66AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetProperty("Name", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 77DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent), 79Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).ServerName, 87AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetProperty("ServerName", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 97DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent), 99Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).Arguments, 100Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).Arguments = value!, 107AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetProperty("Arguments", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IDictionary<string, object>), global::System.Array.Empty<global::System.Type>(), null),
Microsoft.Extensions.AI.Tests (25)
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (1)
2094McpServerToolCallContent mstcc => new McpServerToolCallContent(mstcc.CallId, mstcc.Name, mstcc.ServerName)
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
836var toolCall = new McpServerToolCallContent("mcp-call-2", "dangerousTool", "secureServer")
Generated\361d1da7f942c932\TestJsonSerializerContext.GetJsonTypeInfo.g.cs (1)
174if (type == typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent))
Generated\361d1da7f942c932\TestJsonSerializerContext.McpServerToolCallContent.g.cs (20)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent>? _McpServerToolCallContent; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent> McpServerToolCallContent 22get => _McpServerToolCallContent ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent> Create_McpServerToolCallContent(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.McpServerToolCallContent>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent> jsonTypeInfo)) 29var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.McpServerToolCallContent> 35ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(string), typeof(string), typeof(string)}, modifiers: null), 39jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.McpServerToolCallContent>(options, objectInfo); 56DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent), 58Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).Name, 66AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetProperty("Name", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 77DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent), 79Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).ServerName, 87AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetProperty("ServerName", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), 97DeclaringType = typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent), 99Getter = static obj => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).Arguments, 100Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.McpServerToolCallContent)obj).Arguments = value!, 107AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.McpServerToolCallContent).GetProperty("Arguments", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IDictionary<string, object>), global::System.Array.Empty<global::System.Type>(), null),
parent\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (2)
80McpServerToolCallContent mcp => (mcp.Name, mcp.Arguments), 87McpServerToolCallContent mcp => (mcp.Name, mcp.Arguments),