withRequestLogLevel

Merge a per-request log level into a request's params._meta["io.modelcontextprotocol/logLevel"] (MetaKey.logLevel), per the draft (2026-07-28) server/utilities/logging rule that "Clients control logging verbosity per-request via _meta" (SEP-2575/2577, which removed the logging/setLevel RPC). A conformant draft server MUST NOT emit notifications/message for a request that omits this field, so attaching it is the only way a draft client can opt in to log messages for the request. An empty level leaves params unchanged. Any existing _meta keys are preserved. Exposed so callers can attach a log level to a hand-built params object; only meaningful on a draft-negotiated session.

@safe
Json
withRequestLogLevel
(
Json params
,
string level
)