Urchin.ResourceTemplate (Urchin v0.1.0)

Copy Markdown View Source

A resource template advertised via resources/templates/list.

Mirrors the ResourceTemplate type from the MCP schema. uri_template is an RFC 6570 URI template.

Summary

Functions

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

Serializes the resource template to its JSON-RPC wire shape.

Types

t()

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

Functions

new(attrs)

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

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

to_map(template)

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

Serializes the resource template to its JSON-RPC wire shape.