|
| | ClientPeer (Transport *transport=nullptr, std::string session_id={}, std::weak_ptr< void > transport_lifetime={}) noexcept |
| | Construct a peer from a borrowed transport pointer.
|
| |
|
bool | available () const noexcept |
| | Report whether this peer has a transport to send through.
|
| |
|
bool | supports_roots () const noexcept |
| | Report whether the client advertised roots/list support.
|
| |
|
bool | supports_sampling_tools () const noexcept |
| | Report whether the client advertised sampling support.
|
| |
|
bool | supports_elicitation_form () const noexcept |
| | Report whether the client advertised form elicitation support.
|
| |
|
bool | supports_elicitation_url () const noexcept |
| | Report whether the client advertised URL elicitation support.
|
| |
|
bool | supports_elicitation () const noexcept |
| | Report whether the client supports any elicitation mode.
|
| |
|
bool | supports_task_list () const noexcept |
| | Report whether the client advertised task listing support.
|
| |
|
bool | supports_task_cancel () const noexcept |
| | Report whether the client advertised task cancellation support.
|
| |
|
bool | supports_tasks () const noexcept |
| | Report whether the client advertised any task support.
|
| |
|
core::Result< core::Unit > | notify_cancelled (protocol::RequestId request_id, std::string reason={}) const |
| | Notify the client that a request was cancelled.
|
| |
| RequestHandle< protocol::Json > | request_async (std::string method, protocol::Json params=protocol::Json::object(), RequestOptions options={}) const |
| | Send a raw JSON-RPC request to the client and return a handle.
|
| |
| core::Result< protocol::Json > | request (std::string method, protocol::Json params=protocol::Json::object()) const |
| | Send a raw JSON-RPC request to the client.
|
| |
| core::Result< protocol::RootsListResult > | list_roots () const |
| | Request the client's root list.
|
| |
|
RequestHandle< protocol::RootsListResult > | list_roots_async (RequestOptions options={}) const |
| | Request the client's root list asynchronously.
|
| |
| core::Result< protocol::CreateMessageResult > | create_message (const protocol::CreateMessageParams ¶ms) const |
| | Ask the client to create a sampled message.
|
| |
|
RequestHandle< protocol::CreateMessageResult > | create_message_async (const protocol::CreateMessageParams ¶ms, RequestOptions options={}) const |
| | Ask the client to create a sampled message asynchronously.
|
| |
| core::Result< protocol::CreateElicitationResult > | create_elicitation (const protocol::CreateElicitationRequestParam ¶ms) const |
| | Ask the client to perform an elicitation flow.
|
| |
|
RequestHandle< protocol::CreateElicitationResult > | create_elicitation_async (const protocol::CreateElicitationRequestParam ¶ms, RequestOptions options={}) const |
| | Ask the client to perform an elicitation flow asynchronously.
|
| |
| template<class T > |
| core::Result< T > | elicit (std::string message, RequestOptions options={}) const |
| | Ask the client for typed form input using SchemaTraits<T>.
|
| |
|
template<class T > |
| core::Result< T > | elicit (std::string message, protocol::ElicitationSchema schema, RequestOptions options={}) const |
| | Ask the client for typed form input using an explicit schema.
|
| |
|
template<class T > |
| RequestHandle< T > | elicit_async (std::string message, RequestOptions options={}) const |
| | Async typed form elicitation using SchemaTraits<T>.
|
| |
|
template<class T > |
| RequestHandle< T > | elicit_async (std::string message, protocol::ElicitationSchema schema, RequestOptions options={}) const |
| | Async typed form elicitation using an explicit schema.
|
| |
|
core::Result< core::Unit > | elicit_url (std::string message, std::string elicitation_id, std::string url, RequestOptions options={}) const |
| | Ask the client to complete a URL-based elicitation flow.
|
| |
|
RequestHandle< core::Unit > | elicit_url_async (std::string message, std::string elicitation_id, std::string url, RequestOptions options={}) const |
| | Async URL elicitation helper.
|
| |
| core::Result< std::vector< protocol::Task > > | list_tasks () const |
| | Request one page of tasks from the client.
|
| |
| core::Result< std::vector< protocol::Task > > | list_all_tasks () const |
| | Request all client task pages by following cursors.
|
| |
| core::Result< protocol::Task > | get_task (std::string_view task_id) const |
| | Request a single task by id.
|
| |
| core::Result< protocol::Task > | cancel_task (std::string_view task_id) const |
| | Request cancellation of a client task.
|
| |
| core::Result< protocol::Json > | task_result (std::string_view task_id) const |
| | Request the result payload for a completed client task.
|
| |
| core::Result< core::Unit > | notify_elicitation_complete (std::string elicitation_id) const |
| | Notify the client that an elicitation flow has completed.
|
| |
Non-owning handle for the client associated with a server session.
ClientPeer wraps a borrowed Transport pointer from SessionContext. It is cheap to copy and does not extend the lifetime of either the transport or the underlying MCP session. Use available() before optional peer operations when the context may not have come from a live transport.
New code may prefer the SessionClient or ClientHandle aliases to avoid confusing this session-bound handle with the top-level mcp::ClientPeer.
Methods return core::Result and never throw intentionally. Transport failures, protocol error responses, unsupported client capabilities, and response deserialization failures are propagated as core::Error values.