Table of Contents

Class ResourceContents

Namespace
ModelContextProtocol.Protocol
Assembly
ModelContextProtocol.dll

Provides a base class representing contents of a resource in the Model Context Protocol.

[JsonConverter(typeof(ResourceContents.Converter))]
public abstract class ResourceContents
Inheritance
ResourceContents
Derived
Inherited Members
Extension Methods

Remarks

ResourceContents serves as the base class for different types of resources that can be exchanged through the Model Context Protocol. Resources are identified by URIs and can contain different types of data.

This class is abstract and has two concrete implementations:

See the schema for more details.

Properties

MimeType

Gets or sets the MIME type of the resource content.

[JsonPropertyName("mimeType")]
public string? MimeType { get; set; }

Property Value

string

Uri

Gets or sets the URI of the resource.

[JsonPropertyName("uri")]
public string Uri { get; set; }

Property Value

string