19namespace mcp::server {
37 std::optional<protocol::Json>
meta;
39 std::optional<protocol::TaskRequestParameters>
task;
45 if (!
meta.has_value()) {
48 return protocol::meta_progress_token(*
meta);
Cooperative cancellation primitives shared by SDK lifecycle APIs.
Copyable token observed by cancellation-aware SDK operations.
Definition cancellation.hpp:104
bool cancelled() const noexcept
Returns true after the associated source has requested cancellation.
Definition cancellation.hpp:117
Non-owning handle for the client associated with a server session.
Definition peer.hpp:46
Completion request and result payloads.
Prompt discovery and rendering payloads.
nlohmann::json Json
JSON value type used by all protocol DTOs.
Definition types.hpp:28
Resource listing, template, subscription, and read payloads.
Server-side handle for sending requests and notifications to a client peer.
SessionClient session_client(const SessionContext &context) noexcept
Create a SessionClient handle from a session context.
Definition peer.hpp:870
Parameters for completion/complete.
Definition completion.hpp:98
Completion request context passed to typed completion handlers.
Definition context.hpp:86
protocol::CompleteParams params
Parsed completion/complete request parameters.
Definition context.hpp:88
CancellationToken cancellation
Cooperative cancellation token for this request.
Definition context.hpp:90
bool cancelled() const noexcept
Convenience check for cancellation-aware completion handlers.
Definition context.hpp:93
Invocation context passed to prompt handlers.
Definition context.hpp:56
SessionClient client() const noexcept
Return a non-owning peer handle for this invocation's client.
Definition context.hpp:58
bool cancelled() const noexcept
Convenience check for cancellation-aware handlers.
Definition context.hpp:66
protocol::Json arguments
JSON arguments supplied with the prompt request.
Definition context.hpp:61
CancellationToken cancellation
Cooperative cancellation token for this request.
Definition context.hpp:63
Invocation context passed to resource read handlers.
Definition context.hpp:70
CancellationToken cancellation
Cooperative cancellation token for this request.
Definition context.hpp:79
std::string uri
Requested resource URI.
Definition context.hpp:75
protocol::Json params
Raw resource read parameters supplied by the client.
Definition context.hpp:77
bool cancelled() const noexcept
Convenience check for cancellation-aware handlers.
Definition context.hpp:82
SessionClient client() const noexcept
Return a non-owning peer handle for this invocation's client.
Definition context.hpp:72
Per-message connection metadata supplied to server handlers.
Definition transport.hpp:42
Invocation context passed to tool handlers.
Definition context.hpp:30
protocol::Json arguments
JSON arguments supplied with the tool call.
Definition context.hpp:35
bool cancelled() const noexcept
Convenience check for cancellation-aware handlers.
Definition context.hpp:52
std::optional< protocol::ProgressToken > progress_token() const
Return the tools/call._meta.progressToken, when present.
Definition context.hpp:44
SessionClient client() const noexcept
Return a non-owning peer handle for this invocation's client.
Definition context.hpp:32
std::optional< protocol::Json > meta
Optional tools/call._meta metadata supplied with the tool call.
Definition context.hpp:37
std::optional< protocol::TaskRequestParameters > task
Optional task request metadata supplied with the tool call.
Definition context.hpp:39
CancellationToken cancellation
Cooperative cancellation token for task-aware executions.
Definition context.hpp:41
Asynchronous task status and task-management payloads.