#32 AI agents and MCP 5.5 min
Agent2Agent (A2A) Protocol With Working Python Code
Two agents that share no code can still work together, if they share a protocol.
Add a service and predict the reply
Copy the code folder first. In price_agent.py add a fourth entry to the PRICES table, for example "wheel polish": 20. Predict what the second line of the client output becomes for the question 'How much is a wheel polish?'. The packages for A2A need to be installed as in the video to run it, so this is a prediction task.
A hint
The agent looks for each service name inside the lowercase question.
Ask about two services at once
In client_agent.py change the first question to 'How much is a full service and a basic service?'. Read the found list in price_agent.py and predict the full answer text, including the order of the two prices and what separates them. The matching line, run on its own, gave 'basic service: 45 pounds; full service: 90 pounds'.
A hint
The answers follow the order of the PRICES table, and are joined with a semicolon.
Completed does not mean correct
Predict the state and the answer text for the question 'How much is a service?'. Then explain in one sentence why the task state is still completed, using what the video says completed means.
A hint
No service name in the table appears inside that question.
Read the agent card
Read the CARD in price_agent.py and the first print line in client_agent.py. List the three things the printed card line shows, and name the line in price_agent.py that serves the card at the well known address. Then say what the card does not advertise that a real agent on a network should.
A hint
The video says the card advertises no security.
These tasks are for you to try on your own machine. Nothing is checked or saved.
What this does not show
One made-up price agent and one client on one machine, with no authentication, no HTTPS, no streaming, no input-required tasks and no push notifications. No language model is involved; the answer comes from a small table.
Up next in AI agents and MCP
More in AI agents and MCP
- #01 Local AI Agent in Python: No API Key (Ollama)
- #12 Multi-Agent Patterns in Plain Python: Pipeline, Router, Loop
- #22 OpenAI Agents SDK vs LangGraph vs Plain Python
- #23 Agent Memory: What to Keep and What to Forget
- #24 Approval Gates for Risky Agent Actions
- #25 Tool Errors: Retries, Fallbacks and Made-Up Answers
Related videos
- #232 Give Every AI Agent Its Own Identity Enterprise architecture and AI agents
- #236 Agent Orchestration Patterns: Supervisor, Pipeline, Swarm Enterprise architecture and AI agents
- #237 Where Should AI Agent State and Memory Live? A Crash Test Enterprise architecture and AI agents
- #238 Event-Driven AI Agents: Queues, Crashes and Duplicates Enterprise architecture and AI agents
