Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 4, 2025

Removes EnumerateToolsAsync, EnumeratePromptsAsync, EnumerateResourceTemplatesAsync, and EnumerateResourcesAsync from the public API surface. These scenarios are covered by the corresponding List*Async methods.

Changes:

  • Removed four Enumerate*Async methods from McpClient.Methods.cs
  • Updated XML documentation in McpClientTool, McpClientPrompt, McpClientResourceTemplate, and McpClientResource to reference only List*Async methods
  • Removed tests for deleted methods

Migration:

// Before
await foreach (var tool in client.EnumerateToolsAsync())
{
    // process tool
}

// After
foreach (var tool in await client.ListToolsAsync())
{
    // process tool
}
Original prompt

This section details on the original issue you should resolve

<issue_title>Remove McpClient.Enumerate*Async methods</issue_title>
<issue_description>As discussed in the review of McpClient API feedback, the following members can be removed from public surface of MCPClient.

- public async IAsyncEnumerable<McpClientTool> EnumerateToolsAsync
- public async IAsyncEnumerable<McpClientPrompt> EnumeratePromptsAsync
- public async IAsyncEnumerable<McpClientResourceTemplate> EnumerateResourceTemplatesAsync 
- public async IAsyncEnumerable<McpClientResource> EnumerateResourcesAsync

The scenario satisfied by these API can instead use #1055

@stephentoub @halter73 </issue_description>

<agent_instructions>Please remove these overloads and any references to them (docs, tests, etc.)</agent_instructions>

Comments on the Issue (you are @copilot in this section)


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

…emplatesAsync, and EnumerateResourcesAsync methods

Co-authored-by: stephentoub <[email protected]>
Copilot AI changed the title [WIP] Remove McpClient.Enumerate*Async methods from public API Remove McpClient.Enumerate*Async methods Dec 4, 2025
Copilot AI requested a review from stephentoub December 4, 2025 17:05
@stephentoub stephentoub marked this pull request as ready for review December 4, 2025 17:06
@halter73 halter73 merged commit 627de76 into main Dec 4, 2025
9 of 10 checks passed
@halter73 halter73 deleted the copilot/remove-enumerate-async-methods branch December 4, 2025 19:05
@jeffhandley jeffhandley added the breaking-change This issue or PR introduces a breaking change label Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change This issue or PR introduces a breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove McpClient.Enumerate*Async methods

4 participants