Record Class AgentSkill

java.lang.Object
java.lang.Record
org.a2aproject.sdk.spec.AgentSkill
Record Components:
id - unique identifier for the skill (required, e.g., "weather_query", "translate_text")
name - human-readable name of the skill (required, e.g., "Weather Queries")
description - detailed explanation of what the skill does and how to use it (required)
tags - categorization tags for discovery and filtering (required, may be empty list)
examples - example queries or use cases demonstrating the skill (optional)
inputModes - supported input formats for this skill (optional, inherits from AgentCard if not set)
outputModes - supported output formats for this skill (optional, inherits from AgentCard if not set)
securityRequirements - security requirements specific to this skill (optional)

public record AgentSkill(String id, String name, String description, List<String> tags, @Nullable List<String> examples, @Nullable List<String> inputModes, @Nullable List<String> outputModes, @Nullable List<SecurityRequirement> securityRequirements) extends Record
Represents a distinct skill or capability that an agent can perform in the A2A Protocol.

An AgentSkill defines a specific operation or category of operations that the agent supports. Skills provide a structured way to advertise what an agent can do, helping clients discover and invoke appropriate functionality. Each skill is uniquely identified and includes metadata about supported input/output modes, examples, and security requirements.

Key Components:

  • Identity: Unique ID and human-readable name for discovery and invocation
  • Documentation: Description, examples, and tags for understanding usage
  • Modes: Supported input/output formats (text, audio, image, etc.)
  • Security: Specific authentication/authorization requirements for this skill

Skills are declared in the AgentCard and represent the agent's advertised capabilities. Clients can query available skills to understand what operations are supported and how to invoke them. If inputModes/outputModes are not specified, the skill inherits the defaults from the AgentCard.

This class is immutable and uses the Builder pattern for construction.

See Also:
  • Constructor Details

    • AgentSkill

      public AgentSkill(String id, String name, String description, List<String> tags, @Nullable List<String> examples, @Nullable List<String> inputModes, @Nullable List<String> outputModes, @Nullable List<SecurityRequirement> securityRequirements)
      Compact constructor that validates required fields.
      Parameters:
      id - the id parameter (see class-level JavaDoc)
      name - the name parameter (see class-level JavaDoc)
      description - the description parameter (see class-level JavaDoc)
      tags - the tags parameter (see class-level JavaDoc)
      examples - the examples parameter (see class-level JavaDoc)
      inputModes - the inputModes parameter (see class-level JavaDoc)
      outputModes - the outputModes parameter (see class-level JavaDoc)
      securityRequirements - the security parameter (see class-level JavaDoc)
      Throws:
      IllegalArgumentException - if id, name, description, or tags is null
  • Method Details

    • builder

      public static AgentSkill.Builder builder()
      Create a new Builder
      Returns:
      the builder
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • description

      public String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • tags

      public List<String> tags()
      Returns the value of the tags record component.
      Returns:
      the value of the tags record component
    • examples

      public @Nullable List<String> examples()
      Returns the value of the examples record component.
      Returns:
      the value of the examples record component
    • inputModes

      public @Nullable List<String> inputModes()
      Returns the value of the inputModes record component.
      Returns:
      the value of the inputModes record component
    • outputModes

      public @Nullable List<String> outputModes()
      Returns the value of the outputModes record component.
      Returns:
      the value of the outputModes record component
    • securityRequirements

      public @Nullable List<SecurityRequirement> securityRequirements()
      Returns the value of the securityRequirements record component.
      Returns:
      the value of the securityRequirements record component