OzMcp.Structs.ServerCapabilities (OzMcp v0.9.0)

Copy Markdown View Source

Helper module used to build ServerCapabilities structure.

(MCP protocol: 2025-11-25)

Short example:

%ServerCapabilities{}
  |> ServerCapabilities.resources(true)
  |> ServerCapabilities.build()

Result:

%{resources: %{subscribe: true}}

Long example:

%ServerCapabilities{}
  |> ServerCapabilities.logging(%{})
  |> ServerCapabilities.completions(%{})
  |> ServerCapabilities.resources(true)
  |> ServerCapabilities.tasks(%{}, %{}, %{tools: %{call: %{}}})
  |> ServerCapabilities.build()

Result:

%{
  resources: %{subscribe: true},
  tasks: %{list: %{}, cancel: %{}, requests: %{tools: %{call: %{}}}},
  logging: %{},
  completions: %{}
}

Specification: ServerCapabilities

Fields

FieldSetterTypeRequired
experimentalexperimental/2mapno
logginglogging/2mapno
completionscompletions/2mapno
promptssee the module functionsmapno
resourcessee the module functionsmapno
toolssee the module functionsmapno
taskssee the module functionsmapno

Summary

Types

t()

@type t() :: %OzMcp.Structs.ServerCapabilities{
  completions: map() | nil,
  experimental: map() | nil,
  logging: map() | nil,
  prompts: map() | nil,
  resources: map() | nil,
  tasks: map() | nil,
  tools: map() | nil
}

Functions

build(struct)

@spec build(t()) :: map()

completions(struct, value)

@spec completions(t(), map() | nil) :: t()

experimental(struct, value)

@spec experimental(t(), map() | nil) :: t()

logging(struct, value)

@spec logging(t(), map() | nil) :: t()

resources(struct, subscribe)

@spec resources(t(), boolean() | nil) :: t()

tasks(struct, list, cancel, requests)

@spec tasks(t(), map() | nil, map() | nil, map() | nil) :: t()