Skip to content

3. Agent Skills & 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 these capabilities (its Agent Card).

We'll use the helloworld example located in a2a-samples/samples/python/agents/helloworld/.

Agent Skills

An Agent Skill describes a specific capability or function the agent can perform. It's a building block that tells clients what kinds of tasks the agent is good for.

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 (e.g., "text/plain", "application/json").
  • security_requirements: Security schemes necessary for this skill.

In __main__.py, you can see how a skill for the Helloworld agent is defined:

# 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's named "Returns hello world" and primarily deals with text.

Agent Card

The Agent Card is a JSON document that an A2A Server makes available, typically at a .well-known/agent-card.json endpoint. It's like a digital business card for the agent.

Key attributes of an AgentCard (defined in a2a.types):

  • name, description, version: Basic identity information.
  • supported_interfaces: Ordered list of endpoints and protocols where the A2A service can be reached.
  • capabilities: Supported A2A features like streaming or extended_agent_card.
  • default_input_modes / default_output_modes: Default Media Types for the agent.
  • skills: A list of AgentSkill objects that the agent offers.

The helloworld example defines its 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',
        )
    ],
    # The list of AgentSkill objects that this agent offers
    skills=[skill],
    # Optional attributes (omitted here for simplicity):
    # icon_url                         -> A URL to an icon representing the agent
)

This card tells us the agent is named "Hello World Agent", can be run at http://127.0.0.1:9999/, supports text interactions, and has the hello_world skill.