Skip to content

messages

Class info

Classes

Name Children Inherits
AgentNotificationMessage
aclientp.schema.messages
A message (request, response, or notification) with `"jsonrpc": "2.0"`.
    AgentRequestMessage
    aclientp.schema.messages
    A message (request, response, or notification) with `"jsonrpc": "2.0"`.
      AgentResponseMessage
      aclientp.schema.messages
      A message (request, response, or notification) with `"jsonrpc": "2.0"`.
        ClientNotificationMessage
        aclientp.schema.messages
        A message (request, response, or notification) with `"jsonrpc": "2.0"`.
          ClientRequestMessage
          aclientp.schema.messages
          A message (request, response, or notification) with `"jsonrpc": "2.0"`.
            ClientResponseMessage
            aclientp.schema.messages
            A message (request, response, or notification) with `"jsonrpc": "2.0"`.
              ErrorMessage
              aclientp.schema.messages
              A message (request, response, or notification) with `"jsonrpc": "2.0"`.
                JsonRPCMessage
                aclientp.schema.messages
                JSON-RPC 2.0 message.

                🛈 DocStrings

                Message schema definitions.

                AgentMethod module-attribute

                AgentMethod = Literal[
                    "auth/status",
                    "authenticate",
                    "initialize",
                    "logout",
                    "mcp/message",
                    "providers/disable",
                    "providers/list",
                    "providers/set",
                    "session/archive",
                    "session/cancel",
                    "session/close",
                    "session/delete",
                    "session/fork",
                    "session/list",
                    "session/load",
                    "session/new",
                    "session/options",
                    "session/prompt",
                    "session/resume",
                    "session/set_config_option",
                    "session/set_mode",
                    "session/set_title",
                    "session/status",
                    "session/unarchive",
                ]
                

                Methods handled by the agent.

                ClientMethod module-attribute

                ClientMethod = Literal[
                    "auth/status_update",
                    "elicitation/complete",
                    "elicitation/create",
                    "fs/read_text_file",
                    "fs/write_text_file",
                    "mcp/message",
                    "session/request_permission",
                    "session/update",
                    "terminal/create",
                    "terminal/kill",
                    "terminal/output",
                    "terminal/release",
                    "terminal/wait_for_exit",
                ]
                

                Methods handled by the client.

                ProtocolMethod module-attribute

                ProtocolMethod = Literal['$/cancel_request']
                

                Methods either side may send.

                ProxyMethod module-attribute

                ProxyMethod = Literal['proxy/initialize', 'proxy/successor']
                

                UNSTABLE: Methods handled by proxies in a proxy chain.

                AgentNotificationMessage

                Bases: JsonRPCMessage

                A message (request, response, or notification) with "jsonrpc": "2.0".

                Specified as required by JSON-RPC 2.0 Specification.

                Source code in src/aclientp/schema/messages.py
                class AgentNotificationMessage(JsonRPCMessage):
                    """A message (request, response, or notification) with `"jsonrpc": "2.0"`.
                
                    Specified as [required by JSON-RPC 2.0 Specification][1].
                
                    [1]: https://www.jsonrpc.org/specification#compatibility
                    """
                
                    method: AgentMethod | str
                    """Method name."""
                
                    params: SessionNotification | Any | None = None
                    """Agent notification parameters."""
                

                method instance-attribute

                method: AgentMethod | str
                

                Method name.

                params class-attribute instance-attribute

                params: SessionNotification | Any | None = None
                

                Agent notification parameters.

                AgentRequestMessage

                Bases: JsonRPCMessage

                A message (request, response, or notification) with "jsonrpc": "2.0".

                Specified as required by JSON-RPC 2.0 Specification.

                Source code in src/aclientp/schema/messages.py
                class AgentRequestMessage(JsonRPCMessage):
                    """A message (request, response, or notification) with `"jsonrpc": "2.0"`.
                
                    Specified as [required by JSON-RPC 2.0 Specification][1].
                
                    [1]: https://www.jsonrpc.org/specification#compatibility
                    """
                
                    id: int | str | None
                    """JSON RPC Request Id. Required on requests; ``null`` is allowed but discouraged."""
                
                    method: AgentMethod | str
                    """Method name."""
                
                    params: AgentRequest | Any | None = None
                    """Agent request parameters."""
                

                id instance-attribute

                id: int | str | None
                

                JSON RPC Request Id. Required on requests; null is allowed but discouraged.

                method instance-attribute

                method: AgentMethod | str
                

                Method name.

                params class-attribute instance-attribute

                params: AgentRequest | Any | None = None
                

                Agent request parameters.

                AgentResponseMessage

                Bases: JsonRPCMessage

                A message (request, response, or notification) with "jsonrpc": "2.0".

                Specified as required by JSON-RPC 2.0 Specification.

                Source code in src/aclientp/schema/messages.py
                class AgentResponseMessage(JsonRPCMessage):
                    """A message (request, response, or notification) with `"jsonrpc": "2.0"`.
                
                    Specified as [required by JSON-RPC 2.0 Specification][1].
                
                    [1]: https://www.jsonrpc.org/specification#compatibility
                    """
                
                    id: int | str | None = None
                    """JSON RPC Request Id."""
                
                    result: AgentResponse | Any
                    """All possible responses that an agent can send to a client.
                
                    This enum is used internally for routing RPC responses. You typically won't need
                    to use this directly - the responses are handled automatically by the connection.
                    These are responses to the corresponding `ClientRequest` variants."""
                

                id class-attribute instance-attribute

                id: int | str | None = None
                

                JSON RPC Request Id.

                result instance-attribute

                result: AgentResponse | Any
                

                All possible responses that an agent can send to a client.

                This enum is used internally for routing RPC responses. You typically won't need to use this directly - the responses are handled automatically by the connection. These are responses to the corresponding ClientRequest variants.

                ClientNotificationMessage

                Bases: JsonRPCMessage

                A message (request, response, or notification) with "jsonrpc": "2.0".

                Specified as required by JSON-RPC 2.0 Specification.

                Source code in src/aclientp/schema/messages.py
                class ClientNotificationMessage(JsonRPCMessage):
                    """A message (request, response, or notification) with `"jsonrpc": "2.0"`.
                
                    Specified as [required by JSON-RPC 2.0 Specification][1].
                
                    [1]: https://www.jsonrpc.org/specification#compatibility
                    """
                
                    method: ClientMethod | str
                    """Method name."""
                
                    params: CancelNotification | Any | None = None
                    """Agent notification parameters."""
                

                method instance-attribute

                method: ClientMethod | str
                

                Method name.

                params class-attribute instance-attribute

                params: CancelNotification | Any | None = None
                

                Agent notification parameters.

                ClientRequestMessage

                Bases: JsonRPCMessage

                A message (request, response, or notification) with "jsonrpc": "2.0".

                Specified as required by JSON-RPC 2.0 Specification.

                Source code in src/aclientp/schema/messages.py
                class ClientRequestMessage(JsonRPCMessage):
                    """A message (request, response, or notification) with `"jsonrpc": "2.0"`.
                
                    Specified as [required by JSON-RPC 2.0 Specification][1].
                
                    [1]: https://www.jsonrpc.org/specification#compatibility
                    """
                
                    id: int | str | None
                    """JSON RPC Request Id. Required on requests; ``null`` is allowed but discouraged."""
                
                    method: ClientMethod | str
                    """Method name."""
                
                    params: ClientRequest | Any | None = None
                    """Client request parameters."""
                

                id instance-attribute

                id: int | str | None
                

                JSON RPC Request Id. Required on requests; null is allowed but discouraged.

                method instance-attribute

                method: ClientMethod | str
                

                Method name.

                params class-attribute instance-attribute

                params: ClientRequest | Any | None = None
                

                Client request parameters.

                ClientResponseMessage

                Bases: JsonRPCMessage

                A message (request, response, or notification) with "jsonrpc": "2.0".

                Specified as required by JSON-RPC 2.0 Specification.

                Source code in src/aclientp/schema/messages.py
                class ClientResponseMessage(JsonRPCMessage):
                    """A message (request, response, or notification) with `"jsonrpc": "2.0"`.
                
                    Specified as [required by JSON-RPC 2.0 Specification][1].
                
                    [1]: https://www.jsonrpc.org/specification#compatibility
                    """
                
                    id: int | str | None = None
                    """JSON RPC Request Id."""
                
                    result: ClientResponse | Any
                    """All possible responses that a client can send to an agent.
                
                    This enum is used internally for routing RPC responses. You typically won't need
                    to use this directly - the responses are handled automatically by the connection.
                    These are responses to the corresponding `AgentRequest` variants."""
                

                id class-attribute instance-attribute

                id: int | str | None = None
                

                JSON RPC Request Id.

                result instance-attribute

                result: ClientResponse | Any
                

                All possible responses that a client can send to an agent.

                This enum is used internally for routing RPC responses. You typically won't need to use this directly - the responses are handled automatically by the connection. These are responses to the corresponding AgentRequest variants.

                ErrorMessage

                Bases: JsonRPCMessage

                A message (request, response, or notification) with "jsonrpc": "2.0".

                Specified as required by JSON-RPC 2.0 Specification.

                Source code in src/aclientp/schema/messages.py
                class ErrorMessage(JsonRPCMessage):
                    """A message (request, response, or notification) with `"jsonrpc": "2.0"`.
                
                    Specified as
                    [required by JSON-RPC 2.0 Specification][1].
                
                    [1]: https://www.jsonrpc.org/specification#compatibility
                    """
                
                    id: int | str | None = None
                    """JSON RPC Request Id."""
                
                    error: Error
                

                id class-attribute instance-attribute

                id: int | str | None = None
                

                JSON RPC Request Id.

                JsonRPCMessage

                Bases: Schema

                JSON-RPC 2.0 message.

                Source code in src/aclientp/schema/messages.py
                class JsonRPCMessage(Schema):
                    """JSON-RPC 2.0 message."""
                
                    jsonrpc: Literal["2.0"] = Field(default="2.0", init=False)
                    """JSON RPC Messsage."""
                

                jsonrpc class-attribute instance-attribute

                jsonrpc: Literal['2.0'] = Field(default='2.0', init=False)
                

                JSON RPC Messsage.