Skip to content

elicitation

Class info

Classes

Name Children Inherits
BooleanPropertySchema
aclientp.schema.elicitation
Schema for boolean properties in an elicitation form.
    ElicitationCapabilities
    aclientp.schema.elicitation
    Elicitation capabilities supported by the client.
      ElicitationCompleteNotification
      aclientp.schema.elicitation
      Notification sent by the agent when a URL-based elicitation is complete.
        ElicitationFormCapabilities
        aclientp.schema.elicitation
        Form-based elicitation capabilities.
          ElicitationRequest
          aclientp.schema.elicitation
          Request from the agent to elicit structured user input (``elicitation/create``).
            ElicitationResponse
            aclientp.schema.elicitation
            Response from the client to an elicitation request.
              ElicitationSchema
              aclientp.schema.elicitation
              Type-safe elicitation schema for requesting structured user input.
                ElicitationUrlCapabilities
                aclientp.schema.elicitation
                URL-based elicitation capabilities.
                  EnumOption
                  aclientp.schema.elicitation
                  A titled enum option with a const value, human-readable title and optional description.
                    IntegerPropertySchema
                    aclientp.schema.elicitation
                    Schema for integer properties in an elicitation form.
                      MultiSelectPropertySchema
                      aclientp.schema.elicitation
                      Schema for multi-select (array) properties in an elicitation form.
                        NumberPropertySchema
                        aclientp.schema.elicitation
                        Schema for number (floating-point) properties in an elicitation form.
                          StringFormat
                          aclientp.schema.elicitation
                          String format types for string properties in elicitation schemas.
                            StringPropertySchema
                            aclientp.schema.elicitation
                            Schema for string properties in an elicitation form.
                              TitledMultiSelectItems
                              aclientp.schema.elicitation
                              Items definition for titled multi-select enum properties.
                                UntitledMultiSelectItems
                                aclientp.schema.elicitation
                                Items definition for untitled multi-select enum properties.

                                  🛈 DocStrings

                                  Elicitation schema definitions.

                                  Defines types for agent-initiated elicitation, where the agent requests structured input from the user via forms or URLs.

                                  ElicitationActionType module-attribute

                                  ElicitationActionType = Literal['accept', 'decline', 'cancel'] | str
                                  

                                  User action in response to an elicitation.

                                  ElicitationContentValue module-attribute

                                  ElicitationContentValue = str | int | float | bool | Sequence[str]
                                  

                                  Possible value types in elicitation content.

                                  ElicitationModeType module-attribute

                                  ElicitationModeType = Literal['form', 'url'] | str
                                  

                                  Elicitation mode. Values beginning with _ are implementation-specific.

                                  ElicitationPropertySchema module-attribute

                                  ElicitationPropertySchema = Annotated[
                                      Annotated[StringPropertySchema, Tag("string")]
                                      | Annotated[NumberPropertySchema, Tag("number")]
                                      | Annotated[IntegerPropertySchema, Tag("integer")]
                                      | Annotated[BooleanPropertySchema, Tag("boolean")]
                                      | Annotated[MultiSelectPropertySchema, Tag("array")],
                                      Discriminator(_property_schema_discriminator),
                                  ]
                                  

                                  Property schema for elicitation form fields.

                                  Each variant corresponds to a JSON Schema "type" value.

                                  MultiSelectItems module-attribute

                                  MultiSelectItems = Annotated[
                                      Annotated[UntitledMultiSelectItems, Tag("untitled")]
                                      | Annotated[TitledMultiSelectItems, Tag("titled")],
                                      Discriminator(_multi_select_items_discriminator),
                                  ]
                                  

                                  Items for a multi-select (array) property schema.

                                  BooleanPropertySchema

                                  Bases: AnnotatedObject

                                  Schema for boolean properties in an elicitation form.

                                  Source code in src/aclientp/schema/elicitation.py
                                  class BooleanPropertySchema(AnnotatedObject):
                                      """Schema for boolean properties in an elicitation form."""
                                  
                                      type: Literal["boolean"] = "boolean"
                                      """Type discriminator."""
                                  
                                      title: str | None = None
                                      """Optional title for the property."""
                                  
                                      description: str | None = None
                                      """Human-readable description."""
                                  
                                      default: bool | None = None
                                      """Default value."""
                                  

                                  default class-attribute instance-attribute

                                  default: bool | None = None
                                  

                                  Default value.

                                  description class-attribute instance-attribute

                                  description: str | None = None
                                  

                                  Human-readable description.

                                  title class-attribute instance-attribute

                                  title: str | None = None
                                  

                                  Optional title for the property.

                                  type class-attribute instance-attribute

                                  type: Literal['boolean'] = 'boolean'
                                  

                                  Type discriminator.

                                  ElicitationCapabilities

                                  Bases: AnnotatedObject

                                  Elicitation capabilities supported by the client.

                                  Source code in src/aclientp/schema/elicitation.py
                                  class ElicitationCapabilities(AnnotatedObject):
                                      """Elicitation capabilities supported by the client."""
                                  
                                      form: ElicitationFormCapabilities | None = None
                                      """Whether the client supports form-based elicitation."""
                                  
                                      url: ElicitationUrlCapabilities | None = None
                                      """Whether the client supports URL-based elicitation."""
                                  

                                  form class-attribute instance-attribute

                                  form: ElicitationFormCapabilities | None = None
                                  

                                  Whether the client supports form-based elicitation.

                                  url class-attribute instance-attribute

                                  url: ElicitationUrlCapabilities | None = None
                                  

                                  Whether the client supports URL-based elicitation.

                                  ElicitationCompleteNotification

                                  Bases: AnnotatedObject

                                  Notification sent by the agent when a URL-based elicitation is complete.

                                  Source code in src/aclientp/schema/elicitation.py
                                  class ElicitationCompleteNotification(AnnotatedObject):
                                      """Notification sent by the agent when a URL-based elicitation is complete."""
                                  
                                      elicitation_id: str
                                      """The ID of the elicitation that completed."""
                                  

                                  elicitation_id instance-attribute

                                  elicitation_id: str
                                  

                                  The ID of the elicitation that completed.

                                  ElicitationFormCapabilities

                                  Bases: AnnotatedObject

                                  Form-based elicitation capabilities.

                                  Source code in src/aclientp/schema/elicitation.py
                                  class ElicitationFormCapabilities(AnnotatedObject):
                                      """Form-based elicitation capabilities."""
                                  

                                  ElicitationRequest

                                  Bases: Request

                                  Request from the agent to elicit structured user input (elicitation/create).

                                  The agent sends this to the client to request information from the user, either via a form or by directing them to a URL.

                                  Mode and scope fields are flattened into the request on the wire:

                                  • mode: "form" carries requested_schema.
                                  • mode: "url" carries elicitation_id and url.
                                  • Session scope sets session_id (and optionally tool_call_id), request scope sets request_id (e.g. during auth before any session exists).
                                  Source code in src/aclientp/schema/elicitation.py
                                  class ElicitationRequest(Request):
                                      """Request from the agent to elicit structured user input (``elicitation/create``).
                                  
                                      The agent sends this to the client to request information from the user,
                                      either via a form or by directing them to a URL.
                                  
                                      Mode and scope fields are flattened into the request on the wire:
                                  
                                      - ``mode: "form"`` carries ``requested_schema``.
                                      - ``mode: "url"`` carries ``elicitation_id`` and ``url``.
                                      - Session scope sets ``session_id`` (and optionally ``tool_call_id``),
                                        request scope sets ``request_id`` (e.g. during auth before any session exists).
                                      """
                                  
                                      message: str
                                      """A human-readable message describing what input is needed."""
                                  
                                      mode: ElicitationModeType
                                      """The elicitation mode."""
                                  
                                      requested_schema: ElicitationSchema | None = None
                                      """Form mode: a JSON Schema describing the form fields to present to the user."""
                                  
                                      elicitation_id: str | None = None
                                      """URL mode: the unique identifier for this elicitation."""
                                  
                                      url: str | None = None
                                      """URL mode: the URL to direct the user to."""
                                  
                                      session_id: str | None = None
                                      """Session scope: the session this elicitation is tied to."""
                                  
                                      tool_call_id: str | None = None
                                      """Session scope: optional tool call within the session."""
                                  
                                      request_id: int | str | None = None
                                      """Request scope: the JSON-RPC request this elicitation is tied to."""
                                  
                                      @classmethod
                                      def form(
                                          cls,
                                          message: str,
                                          schema: ElicitationSchema,
                                          *,
                                          session_id: str | None = None,
                                          tool_call_id: str | None = None,
                                          request_id: int | str | None = None,
                                      ) -> Self:
                                          """Create a form-based elicitation request."""
                                          return cls(
                                              message=message,
                                              mode="form",
                                              requested_schema=schema,
                                              session_id=session_id,
                                              tool_call_id=tool_call_id,
                                              request_id=request_id,
                                          )
                                  
                                      @classmethod
                                      def url_based(
                                          cls,
                                          message: str,
                                          elicitation_id: str,
                                          url: str,
                                          *,
                                          session_id: str | None = None,
                                          tool_call_id: str | None = None,
                                          request_id: int | str | None = None,
                                      ) -> Self:
                                          """Create a URL-based elicitation request."""
                                          return cls(
                                              message=message,
                                              mode="url",
                                              elicitation_id=elicitation_id,
                                              url=url,
                                              session_id=session_id,
                                              tool_call_id=tool_call_id,
                                              request_id=request_id,
                                          )
                                  

                                  elicitation_id class-attribute instance-attribute

                                  elicitation_id: str | None = None
                                  

                                  URL mode: the unique identifier for this elicitation.

                                  message instance-attribute

                                  message: str
                                  

                                  A human-readable message describing what input is needed.

                                  mode instance-attribute

                                  The elicitation mode.

                                  request_id class-attribute instance-attribute

                                  request_id: int | str | None = None
                                  

                                  Request scope: the JSON-RPC request this elicitation is tied to.

                                  requested_schema class-attribute instance-attribute

                                  requested_schema: ElicitationSchema | None = None
                                  

                                  Form mode: a JSON Schema describing the form fields to present to the user.

                                  session_id class-attribute instance-attribute

                                  session_id: str | None = None
                                  

                                  Session scope: the session this elicitation is tied to.

                                  tool_call_id class-attribute instance-attribute

                                  tool_call_id: str | None = None
                                  

                                  Session scope: optional tool call within the session.

                                  url class-attribute instance-attribute

                                  url: str | None = None
                                  

                                  URL mode: the URL to direct the user to.

                                  form classmethod

                                  form(
                                      message: str,
                                      schema: ElicitationSchema,
                                      *,
                                      session_id: str | None = None,
                                      tool_call_id: str | None = None,
                                      request_id: int | str | None = None,
                                  ) -> Self
                                  

                                  Create a form-based elicitation request.

                                  Source code in src/aclientp/schema/elicitation.py
                                  @classmethod
                                  def form(
                                      cls,
                                      message: str,
                                      schema: ElicitationSchema,
                                      *,
                                      session_id: str | None = None,
                                      tool_call_id: str | None = None,
                                      request_id: int | str | None = None,
                                  ) -> Self:
                                      """Create a form-based elicitation request."""
                                      return cls(
                                          message=message,
                                          mode="form",
                                          requested_schema=schema,
                                          session_id=session_id,
                                          tool_call_id=tool_call_id,
                                          request_id=request_id,
                                      )
                                  

                                  url_based classmethod

                                  url_based(
                                      message: str,
                                      elicitation_id: str,
                                      url: str,
                                      *,
                                      session_id: str | None = None,
                                      tool_call_id: str | None = None,
                                      request_id: int | str | None = None,
                                  ) -> Self
                                  

                                  Create a URL-based elicitation request.

                                  Source code in src/aclientp/schema/elicitation.py
                                  @classmethod
                                  def url_based(
                                      cls,
                                      message: str,
                                      elicitation_id: str,
                                      url: str,
                                      *,
                                      session_id: str | None = None,
                                      tool_call_id: str | None = None,
                                      request_id: int | str | None = None,
                                  ) -> Self:
                                      """Create a URL-based elicitation request."""
                                      return cls(
                                          message=message,
                                          mode="url",
                                          elicitation_id=elicitation_id,
                                          url=url,
                                          session_id=session_id,
                                          tool_call_id=tool_call_id,
                                          request_id=request_id,
                                      )
                                  

                                  ElicitationResponse

                                  Bases: Response

                                  Response from the client to an elicitation request.

                                  Source code in src/aclientp/schema/elicitation.py
                                  class ElicitationResponse(Response):
                                      """Response from the client to an elicitation request."""
                                  
                                      action: ElicitationActionType
                                      """The user's action."""
                                  
                                      content: dict[str, ElicitationContentValue] | None = None
                                      """For ``accept``: the user-provided content, as an object matching the requested schema."""
                                  
                                      @classmethod
                                      def accept(cls, content: dict[str, ElicitationContentValue] | None = None) -> Self:
                                          return cls(action="accept", content=content)
                                  
                                      @classmethod
                                      def decline(cls) -> Self:
                                          return cls(action="decline")
                                  
                                      @classmethod
                                      def cancel(cls) -> Self:
                                          return cls(action="cancel")
                                  

                                  action instance-attribute

                                  The user's action.

                                  content class-attribute instance-attribute

                                  content: dict[str, ElicitationContentValue] | None = None
                                  

                                  For accept: the user-provided content, as an object matching the requested schema.

                                  ElicitationSchema

                                  Bases: AnnotatedObject

                                  Type-safe elicitation schema for requesting structured user input.

                                  This represents a JSON Schema object with primitive-typed properties, as required by the elicitation specification.

                                  Source code in src/aclientp/schema/elicitation.py
                                  class ElicitationSchema(AnnotatedObject):
                                      """Type-safe elicitation schema for requesting structured user input.
                                  
                                      This represents a JSON Schema object with primitive-typed properties,
                                      as required by the elicitation specification.
                                      """
                                  
                                      type: Literal["object"] = "object"
                                      """Type discriminator. Always ``"object"``."""
                                  
                                      title: str | None = None
                                      """Optional title for the schema."""
                                  
                                      description: str | None = None
                                      """Optional description of what this schema represents."""
                                  
                                      properties: dict[str, ElicitationPropertySchema] = Field(default_factory=dict)
                                      """Property definitions (must be primitive types)."""
                                  
                                      required: Sequence[str] | None = None
                                      """List of required property names."""
                                  

                                  description class-attribute instance-attribute

                                  description: str | None = None
                                  

                                  Optional description of what this schema represents.

                                  properties class-attribute instance-attribute

                                  properties: dict[str, ElicitationPropertySchema] = Field(default_factory=dict)
                                  

                                  Property definitions (must be primitive types).

                                  required class-attribute instance-attribute

                                  required: Sequence[str] | None = None
                                  

                                  List of required property names.

                                  title class-attribute instance-attribute

                                  title: str | None = None
                                  

                                  Optional title for the schema.

                                  type class-attribute instance-attribute

                                  type: Literal['object'] = 'object'
                                  

                                  Type discriminator. Always "object".

                                  ElicitationUrlCapabilities

                                  Bases: AnnotatedObject

                                  URL-based elicitation capabilities.

                                  Source code in src/aclientp/schema/elicitation.py
                                  class ElicitationUrlCapabilities(AnnotatedObject):
                                      """URL-based elicitation capabilities."""
                                  

                                  EnumOption

                                  Bases: AnnotatedObject

                                  A titled enum option with a const value, human-readable title and optional description.

                                  Source code in src/aclientp/schema/elicitation.py
                                  class EnumOption(AnnotatedObject):
                                      """A titled enum option with a const value, human-readable title and optional description."""
                                  
                                      const: str
                                      """The constant value for this option."""
                                  
                                      title: str
                                      """Human-readable title for this option."""
                                  
                                      description: str | None = None
                                      """Human-readable description."""
                                  

                                  const instance-attribute

                                  const: str
                                  

                                  The constant value for this option.

                                  description class-attribute instance-attribute

                                  description: str | None = None
                                  

                                  Human-readable description.

                                  title instance-attribute

                                  title: str
                                  

                                  Human-readable title for this option.

                                  IntegerPropertySchema

                                  Bases: AnnotatedObject

                                  Schema for integer properties in an elicitation form.

                                  Source code in src/aclientp/schema/elicitation.py
                                  class IntegerPropertySchema(AnnotatedObject):
                                      """Schema for integer properties in an elicitation form."""
                                  
                                      type: Literal["integer"] = "integer"
                                      """Type discriminator."""
                                  
                                      title: str | None = None
                                      """Optional title for the property."""
                                  
                                      description: str | None = None
                                      """Human-readable description."""
                                  
                                      minimum: int | None = None
                                      """Minimum value (inclusive)."""
                                  
                                      maximum: int | None = None
                                      """Maximum value (inclusive)."""
                                  
                                      default: int | None = None
                                      """Default value."""
                                  

                                  default class-attribute instance-attribute

                                  default: int | None = None
                                  

                                  Default value.

                                  description class-attribute instance-attribute

                                  description: str | None = None
                                  

                                  Human-readable description.

                                  maximum class-attribute instance-attribute

                                  maximum: int | None = None
                                  

                                  Maximum value (inclusive).

                                  minimum class-attribute instance-attribute

                                  minimum: int | None = None
                                  

                                  Minimum value (inclusive).

                                  title class-attribute instance-attribute

                                  title: str | None = None
                                  

                                  Optional title for the property.

                                  type class-attribute instance-attribute

                                  type: Literal['integer'] = 'integer'
                                  

                                  Type discriminator.

                                  MultiSelectPropertySchema

                                  Bases: AnnotatedObject

                                  Schema for multi-select (array) properties in an elicitation form.

                                  Source code in src/aclientp/schema/elicitation.py
                                  class MultiSelectPropertySchema(AnnotatedObject):
                                      """Schema for multi-select (array) properties in an elicitation form."""
                                  
                                      type: Literal["array"] = "array"
                                      """Type discriminator."""
                                  
                                      title: str | None = None
                                      """Optional title for the property."""
                                  
                                      description: str | None = None
                                      """Human-readable description."""
                                  
                                      min_items: int | None = Field(default=None, ge=0)
                                      """Minimum number of items to select."""
                                  
                                      max_items: int | None = Field(default=None, ge=0)
                                      """Maximum number of items to select."""
                                  
                                      items: MultiSelectItems
                                      """The items definition describing allowed values."""
                                  
                                      default: Sequence[str] | None = None
                                      """Default selected values."""
                                  

                                  default class-attribute instance-attribute

                                  default: Sequence[str] | None = None
                                  

                                  Default selected values.

                                  description class-attribute instance-attribute

                                  description: str | None = None
                                  

                                  Human-readable description.

                                  items instance-attribute

                                  The items definition describing allowed values.

                                  max_items class-attribute instance-attribute

                                  max_items: int | None = Field(default=None, ge=0)
                                  

                                  Maximum number of items to select.

                                  min_items class-attribute instance-attribute

                                  min_items: int | None = Field(default=None, ge=0)
                                  

                                  Minimum number of items to select.

                                  title class-attribute instance-attribute

                                  title: str | None = None
                                  

                                  Optional title for the property.

                                  type class-attribute instance-attribute

                                  type: Literal['array'] = 'array'
                                  

                                  Type discriminator.

                                  NumberPropertySchema

                                  Bases: AnnotatedObject

                                  Schema for number (floating-point) properties in an elicitation form.

                                  Source code in src/aclientp/schema/elicitation.py
                                  class NumberPropertySchema(AnnotatedObject):
                                      """Schema for number (floating-point) properties in an elicitation form."""
                                  
                                      type: Literal["number"] = "number"
                                      """Type discriminator."""
                                  
                                      title: str | None = None
                                      """Optional title for the property."""
                                  
                                      description: str | None = None
                                      """Human-readable description."""
                                  
                                      minimum: float | None = None
                                      """Minimum value (inclusive)."""
                                  
                                      maximum: float | None = None
                                      """Maximum value (inclusive)."""
                                  
                                      default: float | None = None
                                      """Default value."""
                                  

                                  default class-attribute instance-attribute

                                  default: float | None = None
                                  

                                  Default value.

                                  description class-attribute instance-attribute

                                  description: str | None = None
                                  

                                  Human-readable description.

                                  maximum class-attribute instance-attribute

                                  maximum: float | None = None
                                  

                                  Maximum value (inclusive).

                                  minimum class-attribute instance-attribute

                                  minimum: float | None = None
                                  

                                  Minimum value (inclusive).

                                  title class-attribute instance-attribute

                                  title: str | None = None
                                  

                                  Optional title for the property.

                                  type class-attribute instance-attribute

                                  type: Literal['number'] = 'number'
                                  

                                  Type discriminator.

                                  StringFormat

                                  String format types for string properties in elicitation schemas.

                                  Source code in src/aclientp/schema/elicitation.py
                                  class StringFormat:
                                      """String format types for string properties in elicitation schemas."""
                                  
                                      EMAIL: Literal["email"] = "email"
                                      URI: Literal["uri"] = "uri"
                                      DATE: Literal["date"] = "date"
                                      DATE_TIME: Literal["date-time"] = "date-time"
                                  

                                  StringPropertySchema

                                  Bases: AnnotatedObject

                                  Schema for string properties in an elicitation form.

                                  When enum_values or one_of is set, this represents a single-select enum.

                                  Source code in src/aclientp/schema/elicitation.py
                                  class StringPropertySchema(AnnotatedObject):
                                      """Schema for string properties in an elicitation form.
                                  
                                      When ``enum_values`` or ``one_of`` is set, this represents a single-select enum.
                                      """
                                  
                                      type: Literal["string"] = "string"
                                      """Type discriminator."""
                                  
                                      title: str | None = None
                                      """Optional title for the property."""
                                  
                                      description: str | None = None
                                      """Human-readable description."""
                                  
                                      min_length: int | None = Field(default=None, ge=0)
                                      """Minimum string length."""
                                  
                                      max_length: int | None = Field(default=None, ge=0)
                                      """Maximum string length."""
                                  
                                      pattern: str | None = None
                                      """Pattern the string must match."""
                                  
                                      format: StringFormatLiteral | None = None
                                      """String format."""
                                  
                                      default: str | None = None
                                      """Default value."""
                                  
                                      enum: Sequence[str] | None = None
                                      """Enum values for untitled single-select enums."""
                                  
                                      one_of: Sequence[EnumOption] | None = None
                                      """Titled enum options for titled single-select enums."""
                                  

                                  default class-attribute instance-attribute

                                  default: str | None = None
                                  

                                  Default value.

                                  description class-attribute instance-attribute

                                  description: str | None = None
                                  

                                  Human-readable description.

                                  enum class-attribute instance-attribute

                                  enum: Sequence[str] | None = None
                                  

                                  Enum values for untitled single-select enums.

                                  format class-attribute instance-attribute

                                  format: StringFormatLiteral | None = None
                                  

                                  String format.

                                  max_length class-attribute instance-attribute

                                  max_length: int | None = Field(default=None, ge=0)
                                  

                                  Maximum string length.

                                  min_length class-attribute instance-attribute

                                  min_length: int | None = Field(default=None, ge=0)
                                  

                                  Minimum string length.

                                  one_of class-attribute instance-attribute

                                  one_of: Sequence[EnumOption] | None = None
                                  

                                  Titled enum options for titled single-select enums.

                                  pattern class-attribute instance-attribute

                                  pattern: str | None = None
                                  

                                  Pattern the string must match.

                                  title class-attribute instance-attribute

                                  title: str | None = None
                                  

                                  Optional title for the property.

                                  type class-attribute instance-attribute

                                  type: Literal['string'] = 'string'
                                  

                                  Type discriminator.

                                  TitledMultiSelectItems

                                  Bases: AnnotatedObject

                                  Items definition for titled multi-select enum properties.

                                  Source code in src/aclientp/schema/elicitation.py
                                  class TitledMultiSelectItems(AnnotatedObject):
                                      """Items definition for titled multi-select enum properties."""
                                  
                                      any_of: Sequence[EnumOption]
                                      """Titled enum options."""
                                  

                                  any_of instance-attribute

                                  any_of: Sequence[EnumOption]
                                  

                                  Titled enum options.

                                  UntitledMultiSelectItems

                                  Bases: AnnotatedObject

                                  Items definition for untitled multi-select enum properties.

                                  Source code in src/aclientp/schema/elicitation.py
                                  class UntitledMultiSelectItems(AnnotatedObject):
                                      """Items definition for untitled multi-select enum properties."""
                                  
                                      type: Literal["string"] = "string"
                                      """Item type discriminator. Must be ``"string"``."""
                                  
                                      enum: Sequence[str]
                                      """Allowed enum values."""
                                  

                                  enum instance-attribute

                                  enum: Sequence[str]
                                  

                                  Allowed enum values.

                                  type class-attribute instance-attribute

                                  type: Literal['string'] = 'string'
                                  

                                  Item type discriminator. Must be "string".