Skip to main content

Module log_gate

Module log_gate 

Source
Expand description

Which notifications/message records a session has asked to receive.

§Two revisions, two owners of the threshold

Through 2025-11-25 the threshold belongs to the session: logging/setLevel sets it once and every later record is filtered against it. 2026-07-28 moved it onto the request: SEP-2575 replaced the RPC with the io.modelcontextprotocol/logLevel key in _meta, and a request that omits the key receives no log records at all — “the server MUST NOT send any notifications/message notifications for this request”.

One type serves both because the question a handler asks is the same: “will this record be read?”. The gate is shared by every clone of a peer, so a stateful session’s setLevel reaches the requests that follow it, and a stateless request’s gate is built fresh from its own _meta, so no request can inherit another’s.

Structs§

LogGate
A session’s or a request’s log threshold.