AI seeded comments from robch and then edited by stephentoub (#238)

* AI generated `///` comment updates

* Fix compilation issues

* Fix incorrect XML comment structure

* Update all Client comments

* Update all Configuration comments

* Update all Messages comments

* Update all Transport comments

* Update all Types comments

* Update all Server comments

* Undo some commenting

---------

Co-authored-by: Stephen Toub <stoub@microsoft.com>
This commit is contained in:
Rob Chambers 2025-04-09 22:30:44 -07:00 • committed by GitHub
commit 77871c5aac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,4 @@
using Microsoft.Extensions.AI;
using Microsoft.Extensions.AI;
using ModelContextProtocol.Protocol.Types;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
@ -14,13 +14,29 @@ public abstract class McpServerPrompt : IMcpServerPrimitive
}
/// <summary>Gets the protocol <see cref="Prompt"/> type for this instance.</summary>
/// <remarks>
/// The ProtocolPrompt property represents the underlying prompt definition as defined in the
/// Model Context Protocol specification. It contains metadata like the prompt's name,
/// description, and acceptable arguments.
/// </remarks>
public abstract Prompt ProtocolPrompt { get; }
/// <summary>Invokes the <see cref="McpServerPrompt"/>.</summary>
/// <param name="request">The request information resulting in the invocation of this tool.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>The call response from invoking the tool.</returns>
/// <summary>
/// Gets the prompt, rendering it with the provided request parameters and returning the prompt result.
/// </summary>
/// <param name="request">
/// The request context containing information about the prompt invocation, including any arguments
/// passed to the prompt. This object provides access to both the request parameters and the server context.
/// </param>
/// <param name="cancellationToken">
/// The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.
/// </param>
/// <returns>
/// A <see cref="Task"/> representing the asynchronous operation, containing a <see cref="GetPromptResult"/> with
/// the prompt content and messages.
/// </returns>
/// <exception cref="ArgumentNullException"><paramref name="request"/> is <see langword="null"/>.</exception>
/// <exception cref="InvalidOperationException">The prompt implementation returns <see langword="null"/> or an unsupported result type.</exception>
public abstract Task<GetPromptResult> GetAsync(
RequestContext<GetPromptRequestParams> request,
CancellationToken cancellationToken = default);