csharp-sdk/src/ModelContextProtocol.Core/Protocol/ReadResourceRequestParams.cs
Copilot 392e47ea29
Document https:// direct-fetch provision in ReadResourceRequestParams (#1296)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
2026-02-17 09:30:11 -05:00

31 lines
1.3 KiB
C#

using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
namespace ModelContextProtocol.Protocol;
/// <summary>
/// Represents the parameters used with a <see cref="RequestMethods.ResourcesRead"/> request from a client to get a resource provided by a server.
/// </summary>
/// <remarks>
/// <para>
/// The server will respond with a <see cref="ReadResourceResult"/> containing the resulting resource data.
/// </para>
/// <para>
/// Alternatively, if the resource URI uses the <c>https://</c> scheme, clients may fetch the resource
/// directly from the web instead of using <see cref="RequestMethods.ResourcesRead"/>.
/// Servers should only use the <c>https://</c> scheme when the client is able to fetch and load the
/// resource directly on its own.
/// </para>
/// <para>
/// See the <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/">schema</see> for details.
/// </para>
/// </remarks>
public sealed class ReadResourceRequestParams : RequestParams
{
/// <summary>
/// Gets or sets the URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
/// </summary>
[JsonPropertyName("uri")]
[StringSyntax(StringSyntaxAttribute.Uri)]
public required string Uri { get; set; }
}