README

colmugx/mcp/protocol/resource does not have a README file

#
Resource

pub(open) trait Resource {
fn name(Self) -> String
fn description(Self) -> String
fn uri(Self) -> String
fn mime_type(Self) -> String
async fn read(Self) -> Result[ResourceReadResult,
MCPError
]
}

Core Resource trait following MCP protocol
  • name: Resource identifier (unique)
  • description: Human-readable description
  • uri: Resource URI (e.g., "file:///path/to/file")
  • mime_type: MIME type of the resource content
  • read: Async read operation returning resource content

#
ResourceMRTR

pub(open) trait ResourceMRTR {
fn name(Self) -> String
fn description(Self) -> String
fn uri(Self) -> String
fn mime_type(Self) -> String
async fn read(Self, Json) -> Result[ResourceReadOutcome,
MCPError
]
}

MRTR-aware resource trait. Implement this instead of Resource when a resources/read handler needs to suspend and ask the client for input before completing. The read method receives the full read params (after _mrtr_responses has been merged on retry).

#
ResourceContent

pub(all) enum ResourceContent {
Text(String)
Blob(String, mime_type~ : String)
} derive(Eq,
Debug
)

Content type for MCP resource read results Supports text and binary blob content types per MCP spec

#
ResourceDefinition

pub(all) struct ResourceDefinition {
uri : String
name : String
description : String?
mime_type : String?
} derive(Eq,
Debug
)

Resource metadata definition (for protocol responses) Describes a resource in the resources/list response Note: This is separate from the Resource trait which is for implementation

#
ResourceReadOutcome

pub(all) enum ResourceReadOutcome {
Complete(ResourceReadResult)
InputRequired(input_requests~ : Map[String,
InputRequestEntry
], state~ : Json)
} derive(Eq,
Debug
)

The result of a resources/read handler. Per the 2026-07-28 MRTR pattern, a handler may either complete normally (Complete) or request additional client input (InputRequired). On retry, the client resubmits with inputResponses and the echoed requestState; the handler receives those responses via _mrtr_responses in the read params.

#
ResourceReadResult

pub(all) struct ResourceReadResult {
uri : String
content : ResourceContent
} derive(Eq,
Debug
)

Result of reading a resource Contains the URI and content of the resource

#
ResourceTemplateDefinition

pub(all) struct ResourceTemplateDefinition {
uri_template : String
name : String
description : String?
mime_type : String?
} derive(Eq,
Debug
)

Metadata for a resource template returned by resources/templates/list.

Source Files

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io