ExMCP.Protocol.Methods (ex_mcp v1.0.0-rc.8)

Copy Markdown View Source

Canonical registry of MCP methods understood by ExMCP.

Every row records the method name, its inclusive version bounds, whether it is a request or notification, and the consumer-specific handler functions. Consumers derive their dispatch maps and version gates from this registry so method additions do not require parallel string tables.

Unknown methods remain version-available for backward compatibility; the individual dispatchers still decide whether to invoke a custom-method hook or return Method not found.

Summary

Functions

Checks the version bounds for a known method. Unknown methods remain allowed.

Returns a method-to-handler map for a specific dispatcher.

Returns request methods introduced by a version after the base revision.

Returns the methods handled by a specific dispatcher.

Returns the notification methods available in a version.

Returns every canonical method row.

Types

consumer()

@type consumer() :: :server_dispatch | :message_processor | :request_processor

handlers()

@type handlers() :: %{optional(consumer()) => atom()}

kind()

@type kind() :: :request | :notification

row()

@type row() :: {String.t(), version(), version() | nil, kind(), handlers()}

version()

@type version() :: String.t()

Functions

available?(method, version)

@spec available?(String.t(), version()) :: boolean()

Checks the version bounds for a known method. Unknown methods remain allowed.

handler_map(consumer)

@spec handler_map(consumer()) :: %{required(String.t()) => atom()}

Returns a method-to-handler map for a specific dispatcher.

introduced_request_methods(version)

@spec introduced_request_methods(version()) :: [String.t()]

Returns request methods introduced by a version after the base revision.

methods_for(consumer)

@spec methods_for(consumer()) :: [String.t()]

Returns the methods handled by a specific dispatcher.

notification_methods(version)

@spec notification_methods(version()) :: [String.t()]

Returns the notification methods available in a version.

rows()

@spec rows() :: [row()]

Returns every canonical method row.