Lesson 38.3 · 3 of 7 · 5 min read · Reviewed 24 Nov 2026
Agent cards, discovery and capabilities
By the end, you can
- Describe an agent card and what it advertises.
- Explain how clients discover agents.
Before one agent can hand work to another, it needs to know what that agent does and how to talk to it. In A2AAgent-to-agent protocol (A2A): An open protocol for agents built by different vendors to discover each other and exchange tasks. that’s the agentAgent: A system where a model decides its own next steps, calling tools in a loop until the task is done. card.
What’s in a card
{
"name": "Lisbon Hotels Booking Agent",
"description": "Finds and books hotel rooms in Lisbon.",
"url": "https://agents.example-hotels.com/a2a",
"version": "1.2.0",
"capabilities": {"streaming": true, "pushNotifications": true},
"defaultInputModes": ["text/plain"],
"defaultOutputModes": ["text/plain", "application/json"],
"skills": [
{"id": "book-room", "name": "Book a room",
"description": "Search availability and book a room for given dates and budget.",
"examples": ["Book a double room near Alfama, 12-15 March, under 150 EUR a night"]}
],
"securitySchemes": {"oauth": {"type": "oauth2"}}
}
Discovery
- Well-known URL: an agent publishes its card at a standard path on its domain, such as
/.well-known/agent-card.json. - Registries: a company catalogue of approved agents.
- Configuration: you simply configure the card’s URL.
Skills are like tool descriptions
A skillSkill: A folder of instructions, scripts and resources that an agent loads when relevant to a task.’s description and examples do the same job as a tool’s description (34.1). A vague skill gets the wrong tasks, or none.
Key points
- An agent card is a JSON document describing an agent: name, endpoint, skills, supported features and how to authenticate.
- Agents commonly publish their card at a well-known URL, or list it in a registry.
- Clients read the card to decide whether, and how, to send a task.
Validate an agent card and match skills
Check an agent card has what a client needs, then pick the best skill for a request from its description and examples.
You will have: A card checker that lists problems, and a skill matcher that prints the chosen skill and its score.
Steps
- Read the two sample cards: one complete, one missing fields with a vague skill.
- Write check_card(card) to require name, url, skills, capabilities and securitySchemes, and to require https.
- Flag any skill whose description is under 30 characters or has no examples.
- Write best_skill(card, request) scoring word overlap with each skill's description and examples.
- Print the problems for both cards and the skill chosen for a booking request.
Done when
- The complete card has no problems.
- The weak card is flagged for missing securitySchemes, a plain http url and a vague skill.
- The booking request picks the book-room skill.
Open in the Playground No API key needed.
Starter code (Python)
good = {"name": "Lisbon Hotels Booking Agent", "url": "https://agents.example-hotels.com/a2a", "version": "1.2.0",
"capabilities": {"streaming": True, "pushNotifications": True},
"securitySchemes": {"oauth": {"type": "oauth2"}},
"skills": [
{"id": "book-room", "description": "Search availability and book a hotel room for given dates and budget.",
"examples": ["Book a double room near Alfama, 12-15 March"]},
{"id": "cancel-booking", "description": "Cancel an existing booking by its reference number.",
"examples": ["Cancel booking LX-2231"]}]}
weak = {"name": "Docs helper", "url": "http://docs-agent.internal/a2a", "capabilities": {},
"skills": [{"id": "docs", "description": "Helps with documents."}]}
REQUIRED = ["name", "url", "skills", "capabilities", "securitySchemes"]
def check_card(card):
problems = []
# TODO: missing required fields, non-https url, vague skills (short description or no examples)
return problems
def best_skill(card, request):
# TODO: score each skill by words shared with its description and examples
return card["skills"][0]["id"], 0
print("good:", check_card(good))
print("weak:", check_card(weak))
print("chosen:", best_skill(good, "please book a room for two nights in March"))
Show a solution
good = {"name": "Lisbon Hotels Booking Agent", "url": "https://agents.example-hotels.com/a2a", "version": "1.2.0",
"capabilities": {"streaming": True, "pushNotifications": True},
"securitySchemes": {"oauth": {"type": "oauth2"}},
"skills": [
{"id": "book-room", "description": "Search availability and book a hotel room for given dates and budget.",
"examples": ["Book a double room near Alfama, 12-15 March"]},
{"id": "cancel-booking", "description": "Cancel an existing booking by its reference number.",
"examples": ["Cancel booking LX-2231"]}]}
weak = {"name": "Docs helper", "url": "http://docs-agent.internal/a2a", "capabilities": {},
"skills": [{"id": "docs", "description": "Helps with documents."}]}
REQUIRED = ["name", "url", "skills", "capabilities", "securitySchemes"]
def words(text):
return {w.strip(".,").lower() for w in text.split() if len(w) > 2}
def check_card(card):
problems = [f"missing {k}" for k in REQUIRED if k not in card]
if not card.get("url", "").startswith("https://"):
problems.append("url is not https")
for s in card.get("skills", []):
if len(s.get("description", "")) < 30 or not s.get("examples"):
problems.append(f"skill {s['id']} is vague")
return problems
def best_skill(card, request):
req = words(request)
scored = [(len(req & words(s["description"] + " " + " ".join(s.get("examples", [])))), s["id"]) for s in card["skills"]]
score, sid = max(scored)
return sid, score
print("good:", check_card(good))
print("weak:", check_card(weak))
print("chosen:", best_skill(good, "please book a room for two nights in March"))