class

MCProtocol::Resource

Inherits JSON::Serializable < Reference < Object

A known resource that the server is capable of reading.

Constructors

new(name : String, uri : URI, annotations : ResourceAnnotations | Nil = Nil, description : String | Nil = Nil, mimeType : String | Nil = Nil, size : Int64 | Nil = Nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

annotations
Source
description

A description of what this resource represents.

This 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.

Source
mimeType

The MIME type of this resource, if known.

Source
name

A human-readable name for this resource.

This can be used by clients to populate UI elements.

Source
size

The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.

This can be used by Hosts to display file sizes and estimate context window usage.

Source
uri

The URI of this resource.

Source