Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 15, 2025

  • Systematic review of public API surface for missing exception documentation
  • Added exception docs to McpSession.RegisterNotificationHandler (ArgumentNullException, ArgumentException)
  • Added exception docs to McpSession.Methods.SendRequestAsync (ArgumentNullException, ArgumentException, McpException)
  • Added McpException to all McpClient request methods (ListToolsAsync, ListPromptsAsync, GetPromptAsync, ListResourceTemplatesAsync, ListResourcesAsync, ReadResourceAsync, CompleteAsync, SubscribeToResourceAsync, UnsubscribeFromResourceAsync, CallToolAsync, SetLoggingLevelAsync, CreateAsync)
  • Added McpException to McpServer methods (SampleAsync, RequestRootsAsync, ElicitAsync)
  • Added exception docs to client types (McpClientPrompt.GetAsync, McpClientResource.ReadAsync, McpClientResourceTemplate.ReadAsync)
  • Added exception docs to options types (HttpClientTransportOptions.Endpoint, StdioClientTransportOptions.Command)
  • Added exception docs to protocol types (ElicitRequestParams.Mode, Tool.InputSchema, Tool.OutputSchema)
  • Added InvalidOperationException to McpEndpointRouteBuilderExtensions.MapMcp
  • Fixed code review feedback - removed paramref from property setter exception docs
  • Build passes
  • Tests pass (1018 tests)
Original prompt

Systematically review the public surface area, going public member by public member looking for members that can throw exceptions but where those exceptions aren't documented in exception xml tags. Then submit a pr that adds the missing docs. Aggressively ierate until all members are appropriately documented. Do not worry about execution time or the number of iterations it's taking you... the most important thing is to be thorough.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits December 15, 2025 16:47
…tOptions, ElicitRequestParams, Tool, and McpEndpointRouteBuilderExtensions

Co-authored-by: stephentoub <[email protected]>
Copilot AI changed the title [WIP] Update documentation for unlisted exceptions in public members Add missing exception documentation to public API surface Dec 15, 2025
Copilot AI requested a review from stephentoub December 15, 2025 17:13
@stephentoub stephentoub marked this pull request as ready for review December 15, 2025 17:14
@stephentoub
Copy link
Contributor

@copilot, looks good. Any more?

Copy link
Contributor Author

Copilot AI commented Dec 15, 2025

@copilot, looks good. Any more?

I've done a comprehensive review and the main public surface area is now covered. The key additions were:

McpSession/McpClient: RegisterNotificationHandler, SendRequestAsync, and all request methods (ListToolsAsync, GetPromptAsync, ReadResourceAsync, CallToolAsync, etc.) now document McpException.

McpServer: SampleAsync, RequestRootsAsync, ElicitAsync now document McpException.

Client types: McpClientPrompt.GetAsync, McpClientResource.ReadAsync, McpClientResourceTemplate.ReadAsync.

Options/Protocol: HttpClientTransportOptions.Endpoint, StdioClientTransportOptions.Command, ElicitRequestParams.Mode, Tool.InputSchema, Tool.OutputSchema.

ASP.NET Core: MapMcp now documents InvalidOperationException.

Other public members like McpServerPrimitiveCollection, McpServerTool.Create, etc. already had complete exception documentation. The remaining throws in the codebase are in internal/private implementations or stream wrappers that throw NotSupportedException (standard for stream base class methods).

@stephentoub stephentoub merged commit 1b846cb into main Dec 15, 2025
15 of 17 checks passed
@stephentoub stephentoub deleted the copilot/add-missing-exception-docs branch December 15, 2025 17:51
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.

3 participants