Class ResourceLinkBlock
- Namespace
- ModelContextProtocol.Protocol
- Assembly
- ModelContextProtocol.Core.dll
Represents a resource that the server is capable of reading, included in a prompt or tool call result.
public sealed class ResourceLinkBlock : ContentBlock
- Inheritance
-
ResourceLinkBlock
- Inherited Members
- Extension Methods
Remarks
Resource links returned by tools are not guaranteed to appear in the results of resources/list requests.
Properties
Description
Gets or sets a description of what this resource represents.
[JsonPropertyName("description")]
public string? Description { get; set; }
Property Value
Remarks
This description can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.
The description should provide clear context about the resource's content, format, and purpose. This helps AI models make better decisions about when to access or reference the resource.
Client applications can also use this description for display purposes in user interfaces or to help users understand the available resources.
MimeType
Gets or sets the MIME type of this resource.
[JsonPropertyName("mimeType")]
public string? MimeType { get; set; }
Property Value
Remarks
MimeType specifies the format of the resource content, helping clients to properly interpret and display the data. Common MIME types include "text/plain" for plain text, "application/pdf" for PDF documents, "image/png" for PNG images, and "application/json" for JSON data.
This property can be null if the MIME type is unknown or not applicable for the resource.
Name
Gets or sets a human-readable name for this resource.
[JsonPropertyName("name")]
public required string Name { get; set; }
Property Value
Size
Gets or sets the size of the raw resource content (before base64 encoding), in bytes, if known.
[JsonPropertyName("size")]
public long? Size { get; set; }
Property Value
- long?
Remarks
This value can be used by applications to display file sizes and estimate context window usage.
Type
When overridden in a derived class, gets the type of content.
public override string Type { get; }
Property Value
- string
The type of content. Valid values include "image", "audio", "text", "resource", "resource_link", "tool_use", and "tool_result".
Remarks
This value determines the structure of the content object.
Uri
Gets or sets the URI of this resource.
[JsonPropertyName("uri")]
[StringSyntax("Uri")]
public required string Uri { get; set; }