INNER CODE UNIT · Python

ensure_toolbox

stevesolun/ctx · src/ctx/mcp_server/server.py:129

    def ensure_toolbox(self) -> CtxCoreToolbox:
        if self.toolbox is None:
            self.toolbox = CtxCoreToolbox(
                recommendation_session_id=self.recommendation_session_id,
                allowed_tool_names=self.allowed_tool_names,
                allowed_entity_types=self.allowed_entity_types,
            )
        return self.toolbox


# ── Request handlers ──────────────────────────────────────────────────────


def _handle_initialize(state: _ServerState, params: dict[str, Any]) -> dict[str, Any]:
    """Respond to the client's initialize handshake.

    We accept any ``protocolVersion`` string the client sends — MCP
    versions are date-stamped so a mismatch isn't inherently fatal,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…