Overview
Agent cards are JSON documents that describe an A2A agent’s capabilities, skills, and authentication requirements. They follow the A2A Protocol specification and are discovered at the well-known path:Agent Card Structure
A typical agent card includes:agent.json
Fetching Agent Cards
- CLI
- TUI
- Python
- MCP
Fetch and display an agent card:Output includes:
- Agent name and description
- Protocol version
- Capabilities (streaming, push notifications)
- Skills list
- Supported content types
- Authentication requirements
- Transport endpoints
Validating Agent Cards
Handler validates agent cards against the A2A protocol specification using Pydantic models.- Validate from URL
- Validate from file
- MCP
Validation Result Structure
Validation results include detailed information:Understanding Capabilities
Agent cards declare capabilities that affect how you interact with them:- Streaming
- Push Notifications
Indicates whether the agent supports streaming responses:Check in code:If supported, use streaming endpoints for real-time responses:
service.py:307-312
Skills Discovery
Agent cards list available skills:Authentication Requirements
Agent cards specify required authentication:bearer: Bearer token in Authorization headerapi_key: API key in custom headeroauth2: OAuth 2.0 flownone: No authentication required
Transport Endpoints
Cards declare protocol endpoints:jsonrpc transport.
Common Validation Issues
Missing required fields
Missing required fields
Error:Fix: Add the missing field:
Invalid capability values
Invalid capability values
Error:Fix: Use boolean values:
Malformed JSON
Malformed JSON
Error:Fix: Check JSON syntax:
HTTP connection errors
HTTP connection errors
Error:Fix: Ensure agent server is running:
Creating Valid Agent Cards
When building your own agent:Protocol Versions
Handler supports A2A protocol version0.3.0. Check compatibility:
Best Practices
Validate Early
Validate agent cards during development, not in production.
Document Skills
Provide clear skill descriptions so clients understand capabilities.
Specify Content Types
List all supported content types in
supportedContentTypes.Update Protocol Version
Keep
protocolVersion current with your implementation.