Package io.a2a.spec
Class ContentTypeNotSupportedError
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.a2a.spec.A2AError
io.a2a.spec.A2AProtocolError
io.a2a.spec.ContentTypeNotSupportedError
- All Implemented Interfaces:
Event,Serializable
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
);
}
-
Constructor Summary
ConstructorsConstructorDescriptionContentTypeNotSupportedError(@Nullable Integer code, @Nullable String message, @Nullable Object data) Constructs a content type not supported error. -
Method Summary
Methods inherited from class io.a2a.spec.A2AProtocolError
getUrlMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
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 codemessage- the error messagedata- additional error data
-