ResourceLink class

A resource link returned by a tool or included in a prompt.

Note: these links are not guaranteed to appear in resources/list.

Inheritance

Constructors

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

Properties

$meta ↔ MetaObject?
Optional metadata.
getter/setter pairinherited
annotations ↔ Annotations?
Optional client annotations.
getter/setter pairinherited
data ↔ String
Base64-encoded binary data (used for image / audio content).
getter/setter pairinherited
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
MIME type of data.
getter/setter pairinherited
name ↔ String
Programmatic name of the resource.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size ↔ int?
Size of the raw resource in bytes, if known.
getter/setter pair
title ↔ String?
Human-readable display title.
getter/setter pair
type ↔ String
The content type discriminator (e.g. "text", "image", "audio").
getter/setter pairinherited
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 ResourceLink into a JSON-compatible map.
override
toString() → String
A string representation of this object.
inherited

Operators

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