Class InvalidAgentResponseError

All Implemented Interfaces:
Serializable, Event

public class InvalidAgentResponseError extends A2AProtocolError
A2A Protocol error indicating that an agent returned a response not conforming to protocol specifications.

This error is typically raised by client implementations when validating agent responses. It indicates that the agent's response structure, content, or format violates the A2A Protocol requirements for the invoked method.

Common violations:

  • Missing required fields in response objects
  • Invalid field types or values
  • Malformed event stream data
  • Response doesn't match declared agent capabilities

Corresponds to A2A-specific error code -32006.

Usage example:


 SendMessageResponse response = client.sendMessage(request);
 if (response.task() == null) {
     throw new InvalidAgentResponseError(
         null,
         "Response missing required 'task' field",
         null
     );
 }
 
See Also:
  • Constructor Details

    • InvalidAgentResponseError

      public InvalidAgentResponseError(@Nullable Integer code, @Nullable String message, @Nullable Map<String,Object> details)
      Constructs an invalid agent response error.
      Parameters:
      code - the error code
      message - the error message
      details - additional error details