ExMCP.ACP.Capabilities (ex_mcp v1.0.0-rc.0)

View Source

Pure helpers for ACP capability maps.

ACP capabilities are JSON-shaped maps, but callers may pass atom-keyed maps in tests or local APIs. This module centralizes those lookups.

Summary

Functions

ensure(caps, capability)

@spec ensure(map() | nil, atom()) :: :ok | {:error, {:unsupported_capability, atom()}}

from_handler(handler_mod)

@spec from_handler(module()) :: map()

merge(auto, explicit)

@spec merge(map(), map() | nil) :: map()

put(caps, capability, value)

@spec put(map(), atom(), boolean() | map()) :: map()

supported?(caps, capability)

@spec supported?(map() | nil, atom()) :: boolean()