Urchin.Resource (Urchin v0.1.0)

Copy Markdown View Source

A resource definition advertised via resources/list.

Mirrors the Resource type from the MCP schema.

Summary

Functions

Builds a resource from a keyword list or map of attributes.

Serializes the resource to its JSON-RPC wire shape.

Types

t()

@type t() :: %Urchin.Resource{
  annotations: map() | nil,
  description: String.t() | nil,
  icons: [map()] | nil,
  meta: map() | nil,
  mime_type: String.t() | nil,
  name: String.t(),
  size: non_neg_integer() | nil,
  title: String.t() | nil,
  uri: String.t()
}

Functions

new(attrs)

@spec new(keyword() | map()) :: t()

Builds a resource from a keyword list or map of attributes.

to_map(resource)

@spec to_map(t()) :: map()

Serializes the resource to its JSON-RPC wire shape.