class MCProtocol::Resource

Overview

A known resource that the server is capable of reading.

Included Modules

Defined in:

mcprotocol/resource.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : String, uri : URI, annotations : ResourceAnnotations | Nil = Nil, description : String | Nil = Nil, mimeType : String | Nil = Nil, size : Int64 | Nil = Nil) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]

Instance Method Detail

def annotations : ResourceAnnotations | Nil #

[View source]
def description : String | Nil #

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.


[View source]
def mimeType : String | Nil #

The MIME type of this resource, if known.


[View source]
def name : String #

A human-readable name for this resource.

This can be used by clients to populate UI elements.


[View source]
def size : Int64 | Nil #

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.


[View source]
def uri : URI #

The URI of this resource.


[View source]