Record Class HumanConfirmation
java.lang.Object
java.lang.Record
com.eqixiac.equinix.mcp.server.HumanConfirmation
- Record Components:
status- what the client reporteddetail- a one-sentence description of the outcome, suitable for a tool payload
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.
| Status | Observed | Approval given |
|---|---|---|
HumanConfirmation.Status.ACCEPTED | the client returned accept and the form's
confirm field was true | yes |
HumanConfirmation.Status.DECLINED | the client returned decline, or returned
accept without confirm = true | no |
HumanConfirmation.Status.CANCELLED | the client returned cancel (the prompt was
dismissed) | no |
HumanConfirmation.Status.TIMED_OUT | no answer within
ServerContext.elicitTimeoutMillis() ms | no |
HumanConfirmation.Status.FAILED | the round trip threw, was interrupted, or returned no result | no |
HumanConfirmation.Status.CALL_CANCELLED | the client cancelled the tool call
(notifications/cancelled) while the prompt was open | no |
HumanConfirmation.Status.UNSUPPORTED_BY_CLIENT | no client exchange is bound, or the client did not declare form elicitation at initialize; no prompt was sent | not 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhat the client reported for one confirmation prompt. -
Constructor Summary
ConstructorsConstructorDescriptionHumanConfirmation(HumanConfirmation.Status status, String detail) Creates an instance of aHumanConfirmationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepted()detail()Returns the value of thedetailrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.boolean
-
Constructor Details
-
Method Details
-
accepted
public boolean accepted()- Returns:
trueonly forHumanConfirmation.Status.ACCEPTED
-
unsupportedByClient
public boolean unsupportedByClient()- Returns:
truewhen no prompt could be sent because the client cannot service a form elicitation
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
status
-
detail
-