ExMCP.Client.Adapter behaviour (ex_mcp v0.9.2)
View SourceBehaviour for client adapters.
This behaviour defines the interface that all client implementations must satisfy. It allows for different backends (GenServer-based, StateMachine-based, etc.) while maintaining a consistent API.
Summary
Types
Callbacks
@callback batch_request(client(), requests :: [batch_request()], opts :: request_opts()) :: {:ok, [term()]} | error()
@callback list_prompts(client(), opts :: request_opts()) :: {:ok, map()} | error()
@callback list_resource_templates(client(), opts :: request_opts()) :: {:ok, map()} | error()
@callback list_resources(client(), opts :: request_opts()) :: {:ok, map()} | error()
@callback list_roots(client(), opts :: request_opts()) :: {:ok, map()} | error()
@callback list_tools(client(), opts :: request_opts()) :: {:ok, map()} | error()
@callback ping(client(), opts :: request_opts()) :: {:ok, map()} | error()
@callback read_resource(client(), uri :: String.t(), opts :: request_opts()) :: {:ok, term()} | error()
@callback send_batch(client(), requests :: [batch_request()]) :: {:ok, [term()]} | error()
@callback set_log_level(client(), level :: String.t(), opts :: request_opts()) :: {:ok, map()} | error()
@callback stop(client()) :: :ok
@callback subscribe_resource(client(), uri :: String.t(), opts :: request_opts()) :: {:ok, map()} | error()
@callback unsubscribe_resource(client(), uri :: String.t(), opts :: request_opts()) :: {:ok, map()} | error()