Record Class HumanConfirmation

java.lang.Object
java.lang.Record
com.eqixiac.equinix.mcp.server.HumanConfirmation
Record Components:
status - what the client reported
detail - a one-sentence description of the outcome, suitable for a tool payload

public record HumanConfirmation(HumanConfirmation.Status status, String detail) extends Record
The result of asking the person at the MCP client to approve one action through a form elicitation (ServerContext.confirmWithHuman(String), delivered by a HumanConfirmer).

The MCP client is the only party in a tool call that can attest a person saw a prompt and answered it. A tool argument cannot: the calling model writes every argument. This type records what the client reported.

Statuses and what the caller may do
StatusObservedApproval given
HumanConfirmation.Status.ACCEPTEDthe client returned accept and the form's confirm field was trueyes
HumanConfirmation.Status.DECLINEDthe client returned decline, or returned accept without confirm = trueno
HumanConfirmation.Status.CANCELLEDthe client returned cancel (the prompt was dismissed)no
HumanConfirmation.Status.TIMED_OUTno answer within ServerContext.elicitTimeoutMillis() msno
HumanConfirmation.Status.FAILEDthe round trip threw, was interrupted, or returned no resultno
HumanConfirmation.Status.CALL_CANCELLEDthe client cancelled the tool call (notifications/cancelled) while the prompt was openno
HumanConfirmation.Status.UNSUPPORTED_BY_CLIENTno client exchange is bound, or the client did not declare form elicitation at initialize; no prompt was sentnot asked

Limit: an accept proves the client reported an acceptance. A client that answers elicitations without showing them to a person defeats the check; the server cannot detect that.

  • Constructor Details

    • HumanConfirmation

      public HumanConfirmation(HumanConfirmation.Status status, String detail)
      Creates an instance of a HumanConfirmation record class.
      Parameters:
      status - the value for the status record component
      detail - the value for the detail record component
  • Method Details

    • accepted

      public boolean accepted()
      Returns:
      true only for HumanConfirmation.Status.ACCEPTED
    • unsupportedByClient

      public boolean unsupportedByClient()
      Returns:
      true when no prompt could be sent because the client cannot service a form elicitation
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • status

      public HumanConfirmation.Status status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • detail

      public String detail()
      Returns the value of the detail record component.
      Returns:
      the value of the detail record component