INNER CODE UNIT · Python
PARSE_ERROR
stevesolun/ctx · src/ctx/mcp_server/server.py:112
PARSE_ERROR = -32700 # invalid JSON
INVALID_REQUEST = -32600 # not a well-formed request
METHOD_NOT_FOUND = -32601 # method unknown
INVALID_PARAMS = -32602 # params don't match method
INTERNAL_ERROR = -32603 # something inside our handler exploded
@dataclass
class _ServerState:
"""Mutable state for one server instance (one stdin/stdout pair)."""
initialized: bool = False
toolbox: CtxCoreToolbox | None = None
allowed_tool_names: frozenset[str] | None = None
allowed_entity_types: frozenset[str] | None = None
recommendation_session_id: str = field(default_factory=lambda: f"mcp-{uuid4().hex}")
def ensure_toolbox(self) -> CtxCoreToolbox: