Resource class

A known resource that the server can serve.

Inheritance

Constructors

Resource({List<Icon>? icons, required String name, String? title, required String uri, String? description, String? mimeType, Annotations? annotations, int? size, MetaObject? $meta})
Creates a Resource.
Resource.toMCP(Map<String, Object?> map)
Builds a Resource from a decoded MCP JSON map.
factory

Properties

$meta ↔ MetaObject?
Optional metadata.
getter/setter pair
annotations ↔ Annotations?
Optional client annotations.
getter/setter pair
description ↔ String?
Human-readable description.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
icons ↔ List<Icon>?
Optional display icons.
getter/setter pair
mimeType ↔ String?
Optional MIME type.
getter/setter pair
name ↔ String
Programmatic name.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size ↔ int?
Raw resource size in bytes, if known.
getter/setter pair
title ↔ String?
Human-readable display title.
getter/setter pair
uri ↔ String
The resource URI.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() → Map<String, Object?>
Converts this Resource into a JSON-compatible map.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited