You can now use Session Config Options. Dedicated
session mode methods will be removed in a future version of the protocol.
Until then, you can offer both to clients for backwards compatibility.
Initial state
During Session Setup the Agent MAY return a list of modes it can operate in and the currently active mode:The current mode state for the session
SessionModeState
The ID of the mode that is currently active
The set of modes that the Agent can operate in
SessionMode
Unique identifier for this mode
Human-readable name of the mode
Optional description providing more details about what this mode does
Setting the current mode
The current mode can be changed at any point during a session, whether the Agent is idle or generating a response.From the Client
Typically, Clients display the available modes to the user and allow them to change the current one, which they can do by calling thesession/set_mode method.
The ID of the session to set the mode for
The ID of the mode to switch to. Must be one of the modes listed in
availableModesFrom the Agent
The Agent can also change its own mode and let the Client know by sending thecurrent_mode_update session notification:
Exiting plan modes
A common case where an Agent might switch modes is from within a special “exit mode” tool that can be provided to the language model during plan/architect modes. The language model can call this tool when it determines it’s ready to start implementing a solution. This “switch mode” tool will usually request permission before running, which it can do just like any other tool:current_mode_update notification mentioned above.
Learn more about permission requests