Skip to main content

Module session

Module session 

Source
Expand description

Session state tracking for MCP clients.

Tracks whether the current session has been properly initialized via subcog_init. Provides lightweight hints to uninitiated sessions for the first few tool calls.

Constantsยง

MAX_HINTS ๐Ÿ”’
Maximum number of hints to show for uninitialized sessions.

Staticsยง

HINT_COUNT ๐Ÿ”’
INITIALIZED ๐Ÿ”’
Global session state tracker.

Functionsยง

get_hint_message
Returns the initialization hint message.
is_initialized
Checks if the session has been initialized.
mark_initialized
Marks the session as initialized.
should_show_hint
Checks if a hint should be shown and increments the counter.