Repository navigation
A2A 1 · Read the agent card before you trust it #19
Replies: 6 comments 2 replies
|
$ curl -s http://127.0.0.1:9000/.well-known/agent-card.json | python -m json.tool |
from strands import Agent @tool @tool @tool agent = Agent( server = A2AServer(agent=agent) if name == "main": { |
|
{ |
flight_status_broken.pyfrom strands import Agent, tool @tool agent = Agent( server = A2AServer(agent=agent, ) if name == "main": { |
flight_status_broken.pyfrom strands import Agent, tool @tool @tool @tool agent = Agent( server = A2AServer(agent=agent) if name == "main": curl -s http://127.0.0.1:9000/.well-known/agent-card.json | python -m json.tool |
|
(.venv) A-7655@AL007655 a2a_agent % curl -s http://127.0.0.1:9000/.well-known/agent-card.json | python -m json.tool |
Uh oh!
There was an error while loading. Please reload this page.
Exercise 1: Read the Card
Type: Small warm-up | Time: 20 minutes | Work: solo or pairs
This is your first contact with a live A2A agent. Small win first, then one real bug.
Why this matters
A2A discovery is one HTTP GET. No SDK, no credentials, no model call. Any client in any language reads an agent's capabilities from a single JSON file at a well-known path. If that file is wrong, every downstream call fails before it starts.
You will boot a real agent, read its card, find why its card is broken, and fix it.
Setup
pip install -q 'strands-agents[a2a]'You need nothing else for this exercise. No AWS credentials. The Agent Card serves without ever calling a model.
Reference:
01_A2A_with_Strands.ipynb, Part A.The scene
A teammate shipped a Flight Status agent and pinged you the file below. They swear it has two tools. Save it as
flight_status_broken.py.Boot it:
In a second terminal or notebook cell, read the card:
curl -s http://127.0.0.1:9000/.well-known/agent-card.json | python -m json.toolWhat discovery looks like
flowchart LR C["TravelMind client"] -->|"GET /.well-known/agent-card.json"| S["Flight Status A2A server"] S -->|"JSON: name, skills, transport"| C C -->|"now knows what it can call"| CCore task (15 min)
Part 1: Read it (5 min)
From the card JSON, answer these three. Write the answers in a scratch file or chat.
name?protocolVersionandpreferredTransport?skillslist?Part 2: The bug (10 min)
Question 3 has a nasty answer. The
skillslist is empty, even though the agent was given two tools.Your job:
skillsis empty.Bounded done: the card's
skillsarray contains two entries,get_flight_statusandis_disrupted, each carrying the docstring as its description. You can state the one-line cause out loud.Hint if you are stuck after 5 minutes: watch the server's startup logs the moment it boots. It is telling you something about the tools.
Stretch (5 min, optional)
estimate_delay(flight_no), with a clear docstring. Re-read the card. Confirm it appears as a skill with no extra wiring. That auto-conversion is the payoff of doing it right.descriptionto something a calling agent would actually search on, then confirm the card reflects it. A vague description is a discovery failure waiting to happen.Reflection (write 2 lines)
Another agent, built by another team in another language, will read this card to decide whether to call you. If your
skillsare empty or your descriptions are vague, what happens to that agent's decision?Skeptic's corner
"Why not just publish an OpenAPI spec or a README?" Because the Agent Card is a standard at a fixed path that every A2A client already knows how to fetch and parse. A README needs a human. A card needs zero prior agreement. That is the difference between integration and interoperability.
All reactions