JustAMCPResource

Inherits: RefCounted < Object

Inherited By: JustAMCPResourceProjectFile, JustAMCPResourceSystemLogs

Base class for resources exposed through the MCP resource API.

Description

JustAMCPResource defines the interface used by JustAMCPResourceExecutor. Subclasses describe either a fixed URI or URI template and return MCP-compatible content dictionaries when that URI is read.

var resource = JustAMCPResourceProjectFile.new()
print(resource.get_uri())
print(resource.is_template())

Tutorials

Methods

String

get_name() const

Dictionary

get_schema() const

String

get_uri() const

bool

is_template() const

Dictionary

read_resource(uri: String)


Method Descriptions

String get_name() const 🔗

Returns the human-readable resource name displayed to MCP clients.


Dictionary get_schema() const 🔗

Returns this resource's MCP schema dictionary. Fixed resources use uri; templated resources use uriTemplate.


String get_uri() const 🔗

Returns the fixed URI or URI template handled by this resource.


bool is_template() const 🔗

Returns true when this resource handles a URI template rather than one fixed URI.


Dictionary read_resource(uri: String) 🔗

Reads uri and returns an MCP-compatible contents dictionary or an error dictionary.