Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 21, 2026

Combines work from #7201 and #7126. McpServerToolCallContent and McpServerToolResultContent now extend FunctionCallContent and FunctionResultContent respectively. The new InvocationRequired property prevents FunctionInvokingChatClient from re-processing function calls that have already been handled.

Core Changes

  • FunctionCallContent: Unsealed; added InvocationRequired property (defaults to true)
  • FunctionResultContent: Unsealed
  • McpServerToolCallContent: Now extends FunctionCallContent, sets InvocationRequired = false since MCP calls are handled by the service
  • McpServerToolResultContent: Now extends FunctionResultContent, Output property replaced by inherited Result

FunctionInvokingChatClient

  • Skips function calls where InvocationRequired == false
  • Sets InvocationRequired = false after processing a function call
  • Excludes McpServerToolCallContent from approval request/response processing (handled externally)

OpenAI Client

  • Uses FunctionApprovalRequestContent with embedded McpServerToolCallContent instead of McpServerToolApprovalRequestContent
  • Uses FunctionApprovalResponseContent instead of McpServerToolApprovalResponseContent

Example

// MCP tool calls from OpenAI are automatically skipped by FunctionInvokingChatClient
var mcpCall = new McpServerToolCallContent("callId", "toolName", "serverName");
Assert.False(mcpCall.InvocationRequired); // Already handled by service

// Regular function calls still need processing
var functionCall = new FunctionCallContent("callId", "funcName");
Assert.True(functionCall.InvocationRequired);

// After FunctionInvokingChatClient processes it:
functionCall.InvocationRequired = false; // Won't be processed again
Original prompt

Can you create a new PR based off #7201 and also implementing #7126 (even though is closed); the McpServerToolCallContent and McpServerToolResultContent would always set InvocationRequired = false since they represent calls that are handled by the service.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Microsoft Reviewers: Open in CodeFlow

Copilot AI and others added 3 commits January 21, 2026 18:06
…t types

Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
Copilot AI changed the title [WIP] Update MCP server tool call contents to set InvocationRequired to false Add InvocationRequired to FunctionCallContent; make MCP types inherit from base content types Jan 21, 2026
Copilot AI requested a review from jozkee January 21, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants