Skip to content

McpElicitationUrlParams

Base classes

Name Children Inherits
_McpElicitationBase
codexed.models.request_params
Common fields for MCP elicitation requests.

⋔ Inheritance diagram

graph TD
  3947503308["request_params.McpElicitationUrlParams"]
  2277154648["request_params._McpElicitationBase"]
  3116041069["base.CodexBaseModel"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  2277154648 --> 3947503308
  3116041069 --> 2277154648
  3879467795 --> 3116041069
  2751680898 --> 3879467795

🛈 DocStrings

Bases: _McpElicitationBase

URL-mode MCP elicitation request (browser-based auth).

Source code in src/codexed/models/request_params.py
class McpElicitationUrlParams(_McpElicitationBase):
    """URL-mode MCP elicitation request (browser-based auth)."""

    mode: Literal["url"] = "url"
    url: str
    elicitation_id: str

    def to_mcp(self) -> ElicitRequestURLParams:
        from mcp.types import ElicitRequestURLParams

        return ElicitRequestURLParams(
            message=self.message,
            url=self.url,
            elicitation_id=self.elicitation_id,
            meta=_to_mcp_meta(self.meta),
        )

    @classmethod
    def from_mcp(
        cls,
        params: ElicitRequestURLParams,
        thread_id: str,
        server_name: str,
        turn_id: str | None = None,
    ) -> McpElicitationUrlParams:
        """Create from MCP ElicitRequestURLParams.

        Raises:
            ValueError: If the MCP request carries no elicitation ID, which the
                app-server protocol requires to correlate the response
        """
        if params.elicitation_id is None:
            msg = "URL elicitation request without elicitation_id cannot be forwarded"
            raise ValueError(msg)
        return cls(
            message=params.message,
            url=params.url,
            elicitation_id=params.elicitation_id,
            meta=_from_mcp_meta(params.meta),
            thread_id=thread_id,
            server_name=server_name,
            turn_id=turn_id,
        )

from_mcp classmethod

from_mcp(
    params: ElicitRequestURLParams, thread_id: str, server_name: str, turn_id: str | None = None
) -> McpElicitationUrlParams

Create from MCP ElicitRequestURLParams.

Raises:

Type Description
ValueError

If the MCP request carries no elicitation ID, which the app-server protocol requires to correlate the response

Source code in src/codexed/models/request_params.py
@classmethod
def from_mcp(
    cls,
    params: ElicitRequestURLParams,
    thread_id: str,
    server_name: str,
    turn_id: str | None = None,
) -> McpElicitationUrlParams:
    """Create from MCP ElicitRequestURLParams.

    Raises:
        ValueError: If the MCP request carries no elicitation ID, which the
            app-server protocol requires to correlate the response
    """
    if params.elicitation_id is None:
        msg = "URL elicitation request without elicitation_id cannot be forwarded"
        raise ValueError(msg)
    return cls(
        message=params.message,
        url=params.url,
        elicitation_id=params.elicitation_id,
        meta=_from_mcp_meta(params.meta),
        thread_id=thread_id,
        server_name=server_name,
        turn_id=turn_id,
    )

:fa-brands-github: Show source on GitHub