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)- 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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for constructing immutableAgentSkillinstances. -
Constructor Summary
ConstructorsConstructorDescriptionAgentSkill(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. -
Method Summary
Modifier and TypeMethodDescriptionstatic AgentSkill.Builderbuilder()Create a new BuilderReturns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.examples()Returns the value of theexamplesrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of theinputModesrecord component.name()Returns the value of thenamerecord component.Returns the value of theoutputModesrecord component.@Nullable List<SecurityRequirement> Returns the value of thesecurityRequirementsrecord component.tags()Returns the value of thetagsrecord component.final StringtoString()Returns a string representation of this record class.
-
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
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
id
-
name
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
tags
-
examples
-
inputModes
Returns the value of theinputModesrecord component.- Returns:
- the value of the
inputModesrecord component
-
outputModes
Returns the value of theoutputModesrecord component.- Returns:
- the value of the
outputModesrecord component
-
securityRequirements
Returns the value of thesecurityRequirementsrecord component.- Returns:
- the value of the
securityRequirementsrecord component
-