addResource

fun addResource(uri: String, name: String, description: String, mimeType: String = "text/html", readHandler: suspend (ReadResourceRequest) -> ReadResourceResult)(source)

Registers a single resource. The resource content can then be read by the client.

Parameters

uri

The URI of the resource.

name

A human-readable name for the resource.

description

A description of the resource's content.

mimeType

The MIME type of the resource content.

readHandler

A suspend function that returns the resource content when read by the client.

Throws

If the server does not support resources.