learning-it by example

#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.

1. In the Agent2Agent (A2A) protocol, what does an agent publish at a well known address so that other agents can find out what it can do?
2. What is the difference between MCP and A2A, as the video explains it?
3. When the client agent asked the price agent 'How much is a wheel polish?', what did the task come back as?
4. What does a task state of completed tell you in A2A?
5. In the price agent's execute method, what happens after the task is marked as working?

Practice only: nothing is saved and no score counts towards anything. Each answer comes with the reason.

  1. 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.

  2. 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.

  3. 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.

  4. 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

All AI agents and MCP videos

Related videos