Package io.a2a.spec

Class InvalidParamsError

All Implemented Interfaces:
Event, Serializable

public class InvalidParamsError extends A2AError
JSON-RPC error indicating that method parameters are invalid or missing required fields.

This error is returned when a JSON-RPC method is called with parameters that fail validation. Common causes include:

  • Missing required parameters
  • Parameters of incorrect type
  • Parameter values outside acceptable ranges
  • Malformed parameter structures

Corresponds to JSON-RPC 2.0 error code -32602.

Usage example:


 // Default error with standard message
 throw new InvalidParamsError();

 // Custom error message
 throw new InvalidParamsError("taskId parameter is required");
 
See Also:
  • Constructor Details

    • InvalidParamsError

      public InvalidParamsError(@Nullable Integer code, @Nullable String message, @Nullable Object data)
      Constructs an invalid params error with full parameters.
      Parameters:
      code - the error code
      message - the error message
      data - additional error data
    • InvalidParamsError

      public InvalidParamsError(@Nullable String message)
      Constructs an invalid params error with a message.
      Parameters:
      message - the error message
    • InvalidParamsError

      public InvalidParamsError()
      Constructs an invalid params error with default message.