Skip to content

InitializeResponse

Sub classes

Name Children Inherits
InitializeProxyResponse
aclientp.schema.proxy
Response to ``proxy/initialize``. Same as the ``initialize`` response.

    Base classes

    Name Children Inherits
    Response
    aclientp.schema.base
    Base request model.

    â‹” Inheritance diagram

    graph TD
      95970862467248["agent_responses.InitializeResponse"]
      95970861210848["base.Response"]
      95970862258240["base.AnnotatedObject"]
      95970862254416["base.Schema"]
      95970851503232["main.BaseModel"]
      125067848591872["builtins.object"]
      95970861210848 --> 95970862467248
      95970862258240 --> 95970861210848
      95970862254416 --> 95970862258240
      95970851503232 --> 95970862254416
      125067848591872 --> 95970851503232

    🛈 DocStrings

    Bases: Response

    Response from the initialize method.

    Contains the negotiated protocol version and agent capabilities.

    See protocol docs: Initialization

    Source code in src/aclientp/schema/agent_responses.py
    class InitializeResponse(Response):
        """Response from the initialize method.
    
        Contains the negotiated protocol version and agent capabilities.
    
        See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)
        """
    
        agent_capabilities: AgentCapabilities | None = Field(default_factory=AgentCapabilities)
        """Capabilities supported by the agent."""
    
        agent_info: Implementation | None = None
        """Information about the Agent name and version sent to the Client.
    
    
        Note: in future versions of the protocol, this will be required."""
    
        auth_methods: Sequence[AuthMethod] | None = Field(default_factory=list)
        """Authentication methods supported by the agent."""
    
        protocol_version: int = Field(ge=0, le=65535)
        """The protocol version the client specified if supported by the agent.
    
        Or the latest protocol version supported by the agent.
        The client should disconnect, if it doesn't support this version.
        """
    
        @classmethod
        def create(
            cls,
            name: str,
            title: str,
            version: str,
            protocol_version: int,
            load_session: bool | None = False,
            http_mcp_servers: bool = False,
            sse_mcp_servers: bool = False,
            audio_prompts: bool = False,
            embedded_context_prompts: bool = False,
            image_prompts: bool = False,
            list_sessions: bool = False,
            resume_session: bool = False,
            close_session: bool = False,
            auth_methods: Sequence[AuthMethod] | None = None,
        ) -> Self:
            """Create an instance of AgentCapabilities.
    
            Args:
                name: The name of the agent.
                title: The title of the agent.
                version: The version of the agent.
                protocol_version: The protocol version of the agent.
                load_session: Whether the agent supports `session/load`.
                http_mcp_servers: Whether the agent supports HTTP MCP servers.
                sse_mcp_servers: Whether the agent supports SSE MCP servers.
                audio_prompts: Whether the agent supports audio prompts.
                embedded_context_prompts: Whether the agent supports embedded context prompts.
                image_prompts: Whether the agent supports image prompts.
                list_sessions: Whether the agent supports `session/list`.
                resume_session: Whether the agent supports `session/resume`.
                close_session: Whether the agent supports `session/close`.
                auth_methods: The authentication methods supported by the agent.
            """
            caps = AgentCapabilities.create(
                load_session=load_session,
                http_mcp_servers=http_mcp_servers,
                sse_mcp_servers=sse_mcp_servers,
                audio_prompts=audio_prompts,
                embedded_context_prompts=embedded_context_prompts,
                image_prompts=image_prompts,
                list_sessions=list_sessions,
                resume_session=resume_session,
                close_session=close_session,
            )
            return cls(
                agent_info=Implementation(name=name, title=title, version=version),
                protocol_version=protocol_version,
                agent_capabilities=caps,
                auth_methods=auth_methods,
            )
    

    agent_capabilities class-attribute instance-attribute

    agent_capabilities: AgentCapabilities | None = Field(default_factory=AgentCapabilities)
    

    Capabilities supported by the agent.

    agent_info class-attribute instance-attribute

    agent_info: Implementation | None = None
    

    Information about the Agent name and version sent to the Client.

    Note: in future versions of the protocol, this will be required.

    auth_methods class-attribute instance-attribute

    auth_methods: Sequence[AuthMethod] | None = Field(default_factory=list)
    

    Authentication methods supported by the agent.

    protocol_version class-attribute instance-attribute

    protocol_version: int = Field(ge=0, le=65535)
    

    The protocol version the client specified if supported by the agent.

    Or the latest protocol version supported by the agent. The client should disconnect, if it doesn't support this version.

    create classmethod

    create(
        name: str,
        title: str,
        version: str,
        protocol_version: int,
        load_session: bool | None = False,
        http_mcp_servers: bool = False,
        sse_mcp_servers: bool = False,
        audio_prompts: bool = False,
        embedded_context_prompts: bool = False,
        image_prompts: bool = False,
        list_sessions: bool = False,
        resume_session: bool = False,
        close_session: bool = False,
        auth_methods: Sequence[AuthMethod] | None = None,
    ) -> Self
    

    Create an instance of AgentCapabilities.

    Parameters:

    Name Type Description Default
    name str

    The name of the agent.

    required
    title str

    The title of the agent.

    required
    version str

    The version of the agent.

    required
    protocol_version int

    The protocol version of the agent.

    required
    load_session bool | None

    Whether the agent supports session/load.

    False
    http_mcp_servers bool

    Whether the agent supports HTTP MCP servers.

    False
    sse_mcp_servers bool

    Whether the agent supports SSE MCP servers.

    False
    audio_prompts bool

    Whether the agent supports audio prompts.

    False
    embedded_context_prompts bool

    Whether the agent supports embedded context prompts.

    False
    image_prompts bool

    Whether the agent supports image prompts.

    False
    list_sessions bool

    Whether the agent supports session/list.

    False
    resume_session bool

    Whether the agent supports session/resume.

    False
    close_session bool

    Whether the agent supports session/close.

    False
    auth_methods Sequence[AuthMethod] | None

    The authentication methods supported by the agent.

    None
    Source code in src/aclientp/schema/agent_responses.py
    @classmethod
    def create(
        cls,
        name: str,
        title: str,
        version: str,
        protocol_version: int,
        load_session: bool | None = False,
        http_mcp_servers: bool = False,
        sse_mcp_servers: bool = False,
        audio_prompts: bool = False,
        embedded_context_prompts: bool = False,
        image_prompts: bool = False,
        list_sessions: bool = False,
        resume_session: bool = False,
        close_session: bool = False,
        auth_methods: Sequence[AuthMethod] | None = None,
    ) -> Self:
        """Create an instance of AgentCapabilities.
    
        Args:
            name: The name of the agent.
            title: The title of the agent.
            version: The version of the agent.
            protocol_version: The protocol version of the agent.
            load_session: Whether the agent supports `session/load`.
            http_mcp_servers: Whether the agent supports HTTP MCP servers.
            sse_mcp_servers: Whether the agent supports SSE MCP servers.
            audio_prompts: Whether the agent supports audio prompts.
            embedded_context_prompts: Whether the agent supports embedded context prompts.
            image_prompts: Whether the agent supports image prompts.
            list_sessions: Whether the agent supports `session/list`.
            resume_session: Whether the agent supports `session/resume`.
            close_session: Whether the agent supports `session/close`.
            auth_methods: The authentication methods supported by the agent.
        """
        caps = AgentCapabilities.create(
            load_session=load_session,
            http_mcp_servers=http_mcp_servers,
            sse_mcp_servers=sse_mcp_servers,
            audio_prompts=audio_prompts,
            embedded_context_prompts=embedded_context_prompts,
            image_prompts=image_prompts,
            list_sessions=list_sessions,
            resume_session=resume_session,
            close_session=close_session,
        )
        return cls(
            agent_info=Implementation(name=name, title=title, version=version),
            protocol_version=protocol_version,
            agent_capabilities=caps,
            auth_methods=auth_methods,
        )
    

    :fa-brands-github: Show source on GitHub