Skip to content

AgentCapabilities

Base classes

Name Children Inherits
AnnotatedObject
aclientp.schema.base
Base class for generated models.

â‹” Inheritance diagram

graph TD
  95970862500784["capabilities.AgentCapabilities"]
  95970862258240["base.AnnotatedObject"]
  95970862254416["base.Schema"]
  95970851503232["main.BaseModel"]
  125067848591872["builtins.object"]
  95970862258240 --> 95970862500784
  95970862254416 --> 95970862258240
  95970851503232 --> 95970862254416
  125067848591872 --> 95970851503232

🛈 DocStrings

Bases: AnnotatedObject

Capabilities supported by the agent.

Advertised during initialization to inform the client about available features and content types.

See protocol docs: Agent Capabilities

Source code in src/aclientp/schema/capabilities.py
class AgentCapabilities(AnnotatedObject):
    """Capabilities supported by the agent.

    Advertised during initialization to inform the client about
    available features and content types.

    See protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol/initialization#agent-capabilities)
    """

    auth: AgentAuthCapabilities | None = Field(default_factory=AgentAuthCapabilities)
    """Authentication-related capabilities supported by the agent."""

    providers: ProvidersCapabilities | None = None
    """**UNSTABLE**: LLM provider configuration support."""

    load_session: bool | None = False
    """Whether the agent supports `session/load`."""

    mcp_capabilities: McpCapabilities | None = Field(default_factory=McpCapabilities)
    """MCP capabilities supported by the agent."""

    prompt_capabilities: PromptCapabilities | None = Field(default_factory=PromptCapabilities)
    """Prompt capabilities supported by the agent."""

    session_capabilities: SessionCapabilities | None = Field(default_factory=SessionCapabilities)
    """Session capabilities supported by the agent."""

    @classmethod
    def create(
        cls,
        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,
    ) -> Self:
        """Create an instance of AgentCapabilities.

        Args:
            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`.
        """
        session_caps = SessionCapabilities(
            list=SessionListCapabilities() if list_sessions else None,
            resume=SessionResumeCapabilities() if resume_session else None,
            close=SessionCloseCapabilities() if close_session else None,
        )
        return cls(
            load_session=load_session,
            mcp_capabilities=McpCapabilities(http=http_mcp_servers, sse=sse_mcp_servers),
            prompt_capabilities=PromptCapabilities(
                audio=audio_prompts,
                embedded_context=embedded_context_prompts,
                image=image_prompts,
            ),
            session_capabilities=session_caps,
        )

auth class-attribute instance-attribute

auth: AgentAuthCapabilities | None = Field(default_factory=AgentAuthCapabilities)

Authentication-related capabilities supported by the agent.

load_session class-attribute instance-attribute

load_session: bool | None = False

Whether the agent supports session/load.

mcp_capabilities class-attribute instance-attribute

mcp_capabilities: McpCapabilities | None = Field(default_factory=McpCapabilities)

MCP capabilities supported by the agent.

prompt_capabilities class-attribute instance-attribute

prompt_capabilities: PromptCapabilities | None = Field(default_factory=PromptCapabilities)

Prompt capabilities supported by the agent.

providers class-attribute instance-attribute

providers: ProvidersCapabilities | None = None

UNSTABLE: LLM provider configuration support.

session_capabilities class-attribute instance-attribute

session_capabilities: SessionCapabilities | None = Field(default_factory=SessionCapabilities)

Session capabilities supported by the agent.

create classmethod

create(
    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,
) -> Self

Create an instance of AgentCapabilities.

Parameters:

Name Type Description Default
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
Source code in src/aclientp/schema/capabilities.py
@classmethod
def create(
    cls,
    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,
) -> Self:
    """Create an instance of AgentCapabilities.

    Args:
        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`.
    """
    session_caps = SessionCapabilities(
        list=SessionListCapabilities() if list_sessions else None,
        resume=SessionResumeCapabilities() if resume_session else None,
        close=SessionCloseCapabilities() if close_session else None,
    )
    return cls(
        load_session=load_session,
        mcp_capabilities=McpCapabilities(http=http_mcp_servers, sse=sse_mcp_servers),
        prompt_capabilities=PromptCapabilities(
            audio=audio_prompts,
            embedded_context=embedded_context_prompts,
            image=image_prompts,
        ),
        session_capabilities=session_caps,
    )

:fa-brands-github: Show source on GitHub