3. Agent Skills and Agent Card
Before an A2A agent can do anything, it needs to define what it can do (its skills) and how other agents or clients can find out about those capabilities (its Agent Card).
This tutorial uses the helloworld sample in a2a-samples/samples/python/agents/helloworld/
.
Agent skills
An Agent Skill describes a specific capability or function the agent can perform. It is a building block that tells clients what kinds of tasks the agent is good for.
The main attributes of an AgentSkill (defined in a2a.types):
id: a unique identifier for the skill.name: a human-readable name.description: a more detailed explanation of what the skill does.tags: keywords for categorization and discovery.examples: sample prompts or use cases.input_modes/output_modes: supported media types for input and output (for exampletext/plainandapplication/json).security_requirements: the security schemes necessary for this skill.
In __main__.py, the skill for the Helloworld agent is defined like this:
# Defines the abilities or functions that agent can perform.
skill = AgentSkill(
id='echo_bot',
name='Echo Bot',
description='An example agent that acknowledges client request and responds with a "Hello World" message.',
input_modes=['text/plain'],
output_modes=['text/plain'],
tags=['a2a', 'echo-example'],
examples=['hi', 'how are you'],
)This skill is very simple: it is named “Echo Bot” and mainly deals with text.
Agent Card
The Agent Card is a JSON document that an A2A server makes available, typically at the /.well-known/agent-card.json endpoint. It is like a digital business card for the agent.
The main attributes of an AgentCard (defined in a2a.types):
name,description,version: basic identity information.supported_interfaces: an ordered list of endpoints and protocols where the A2A service can be reached.capabilities: supported A2A features such asstreamingorextended_agent_card.default_input_modes/default_output_modes: the agent’s default media types.skills: the list ofAgentSkillobjects the agent offers.
The helloworld sample defines its public Agent Card like this:
# Define a public-facing agent card that allows clients to discover your agent's capabilities.
public_agent_card = AgentCard(
# Basic identity information of A2A server
name='Hello World Agent', # Identity
description='Just a hello world agent',
version='0.0.1',
# Default Media Types for the agent's interactions
default_input_modes=['text/plain'], # Supported media types
default_output_modes=['text/plain'],
# Supported A2A features (like streaming or extended config)
capabilities=AgentCapabilities(streaming=True, extended_agent_card=True),
# Ordered list of endpoints and protocols where the service can be reached
supported_interfaces=[
AgentInterface(
protocol_binding='JSONRPC',
url='http://127.0.0.1:9999',
protocol_version='1.0',
)
],
# The list of AgentSkill objects that this agent offers
skills=[skill],
)This card says the agent is named “Hello World Agent”, runs at http://127.0.0.1:9999 using the JSON-RPC binding and protocol version 1.0, supports text interactions and streaming, and has the echo_bot skill. For the full fields and semantics, see Agent Discovery
and the Specification
.
Next step
Next, implement the agent’s core logic: The Agent Executor .
Source: A2A official documentation · Agent Skills & Agent Card