A2a Protocol
Builds Agent-to-Agent (A2A) servers and clients following Google's open protocol for...
Install
npx skills add internet-court/internet-court-skill --skill a2a-protocol -g -a claude-code -y- Repository
- internet-court/internet-court-skill7k
- Category
- AI and agents
- Updated
- 9d ago
- License
- Apache-2.0
- Context cost
- Mediumabout 2,236 tokens
- Runs scripts
- No, instructions only
What it does
Builds Agent-to-Agent (A2A) servers and clients following Google's open protocol for agent interoperability. Use when the user wants to create an A2A-compliant agent, build an Agent Card, implement task management, connect agents across frameworks, set up agent discovery, handle streaming responses, implement push notifications, or orchestrate multi-agent workflows. Trigger words: a2a, agent to agent, agent2agent, a2a protocol, a2a server, a2a client, agent card, agent interoperability, agent collaboration, multi-agent, agent discovery, a2a sdk, a2a task.
A2A Protocol
Overview
Implements the Agent2Agent (A2A) open protocol for communication between AI agents built on different frameworks. A2A enables agents to discover each other via Agent Cards, negotiate interaction modalities, manage collaborative tasks, and exchange data, all without exposing internal state, memory, or tools. Supports JSON-RPC 2.0 over HTTP(S), streaming via SSE, gRPC, and async push notifications.
Instructions
1. Core Concepts
- A2A Client: Initiates requests to an A2A Server (on behalf of a user or another agent)
- A2A Server (Remote Agent): Exposes an A2A-compliant endpoint, processes tasks
- Agent Card: JSON metadata at
/.well-known/agent.jsondescribing identity, capabilities, skills, endpoint, auth - Task: Unit of work with lifecycle (submitted → working → input-required → completed/failed/canceled/rejected)
- Message: Communication turn (role: "user" or "agent") containing Parts (text, file, or JSON)
- Artifact: Output generated by the agent (documents, images, structured data)
2. Python SDK Setup
pip install a2a-sdk # Core
pip install "a2a-sdk[http-server]" # With FastAPI/Starlette
pip install "a2a-sdk[grpc]" # With gRPC
3. Building an A2A Server (Python)
from a2a.types import AgentCard, AgentSkill, AgentCapabilities
from a2a.server.agent_execution import AgentExecutor, RequestContext
from a2a.server.events import EventQueue
from a2a.server.apps.starlette import A2AStarletteApplication
from a2a.server.request_handler import DefaultRequestHandler
from a2a.types import Message, TextPart, TaskState, TaskStatus
import uvicorn

