Package io.a2a.spec

Class ContentTypeNotSupportedError

All Implemented Interfaces:
Event, Serializable

public class ContentTypeNotSupportedError extends A2AProtocolError
A2A Protocol error indicating incompatibility between requested content types and agent capabilities.

This error is returned when the input or output modes requested by a client are not supported by the agent. Agents declare their supported content types via AgentCard.defaultInputModes() and AgentCard.defaultOutputModes(), and clients can request specific modes via MessageSendConfiguration.

Common scenarios:

  • Client requests audio input but agent only supports text
  • Client requires video output but agent only produces text and images
  • Incompatible combinations of input and output modes

Corresponds to A2A-specific error code -32005.

Usage example:


 if (!agentCard.defaultInputModes().contains(requestedInputMode)) {
     throw new ContentTypeNotSupportedError(
         null,
         "Input mode " + requestedInputMode + " not supported",
         null
     );
 }
 
See Also:
  • Constructor Details

    • ContentTypeNotSupportedError

      public ContentTypeNotSupportedError()
    • ContentTypeNotSupportedError

      public ContentTypeNotSupportedError(@Nullable Integer code, @Nullable String message, @Nullable Object data)
      Constructs a content type not supported error.
      Parameters:
      code - the error code
      message - the error message
      data - additional error data