Helper module used to build ResourceLink structure.
(MCP protocol: 2025-11-25)
Short example:
%ResourceLink{}
|> ResourceLink.uri("file:///logs/app.log")
|> ResourceLink.name("app.log")
|> ResourceLink.build()Result:
%{name: "app.log", type: "resource_link", uri: "file:///logs/app.log"}Long example:
%ResourceLink{}
|> ResourceLink.uri("file:///logs/app.log")
|> ResourceLink.name("app.log")
|> ResourceLink.title("Application log")
|> ResourceLink.description("Main application log file")
|> ResourceLink.mime_type("text/plain")
|> ResourceLink.size(1024)
|> ResourceLink.annotations(
%Annotations{}
|> Annotations.audience(["assistant"])
)
|> ResourceLink.build()Result:
%{
name: "app.log",
size: 1024,
type: "resource_link",
description: "Main application log file",
title: "Application log",
uri: "file:///logs/app.log",
annotations: %{audience: ["assistant"]},
mimeType: "text/plain"
}Specification: ResourceLink
Fields
| Field | Setter | Type | Required |
|---|---|---|---|
uri | uri/2 | string | yes |
name | name/2 | string | yes |
title | title/2 | string | no |
description | description/2 | string | no |
mimeType | mime_type/2 | string | no |
_meta | _meta/2 | map | no |
icons | icons/2 | list of OzMcp.Structs.Icon.t/0 | no |
annotations | annotations/2 | OzMcp.Structs.Annotations.t/0 | no |
size | size/2 | non-negative integer | no |
Summary
Types
@type t() :: %OzMcp.Structs.ResourceLink{ _meta: map() | nil, annotations: OzMcp.Structs.Annotations.t() | nil, description: String.t() | nil, icons: [OzMcp.Structs.Icon.t()] | nil, mimeType: String.t() | nil, name: String.t(), size: non_neg_integer() | nil, title: String.t() | nil, uri: String.t() }
Functions
@spec annotations(t(), OzMcp.Structs.Annotations.t() | nil) :: t()
@spec icons(t(), [OzMcp.Structs.Icon.t()] | nil) :: t()
@spec size(t(), non_neg_integer() | nil) :: t()