Skip to content

Commit b1abc0a

Browse files
committed
docs: Server documentation example and template based on openapi and openrpc standards
1 parent 18998ab commit b1abc0a

File tree

4 files changed

+2324
-0
lines changed

4 files changed

+2324
-0
lines changed

docs/community.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ The launch of A2A has sparked lively discussions and positive reactions on vario
4141
- PydanticAI example [PR\#127](https://github.com/google/A2A/pull/127)
4242
- Go example [PR\#52](https://github.com/google/A2A/pull/52)
4343
- Daytona sandbox running agent [PR\#170](https://github.com/google/A2A/pull/170)
44+
- Server documentation example and template
4445

4546
## What is Driving This Excitement?
4647

Lines changed: 269 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,269 @@
1+
openapi: 3.1.0
2+
info:
3+
title: Agent-to-Agent AgentCard Discovery
4+
version: 1.0.0
5+
description: >
6+
Specification for serving an AgentCard at the well-known endpoint
7+
/.well-known/agent.json according to the A2A protocol.
8+
The AgentCard conveys key information about an A2A Server including its identity,
9+
service endpoints, capabilities, authentication requirements, and skills.
10+
11+
servers:
12+
- url: https://{server_domain}
13+
variables:
14+
server_domain:
15+
default: example.com
16+
description: The domain where the agent is hosted
17+
18+
paths:
19+
/.well-known/agent.json:
20+
get:
21+
summary: Retrieve AgentCard
22+
description: >
23+
Returns the AgentCard describing the agent's capabilities, skills,
24+
and authentication requirements. The AgentCard serves as the primary
25+
discovery mechanism for agents in the A2A ecosystem.
26+
operationId: getAgentCard
27+
responses:
28+
'200':
29+
description: AgentCard retrieved successfully
30+
content:
31+
application/json:
32+
schema:
33+
$ref: '#/components/schemas/AgentCard'
34+
example:
35+
name: "Recipe Advisor Agent"
36+
description: "Helps users find recipes and plan meals"
37+
url: "https://agent.example.com/a2a/api"
38+
version: "1.0.0"
39+
capabilities:
40+
streaming: true
41+
pushNotifications: false
42+
skills:
43+
- id: "recipe-finder"
44+
name: "Recipe Finder"
45+
description: "Finds recipes based on ingredients and dietary restrictions"
46+
'401':
47+
description: Unauthorized - Authentication failed or was not provided
48+
'403':
49+
description: Forbidden - Client lacks permission to access the AgentCard
50+
'500':
51+
description: Server error - Unexpected condition prevented fulfilling the request
52+
53+
security:
54+
- BearerAuth: []
55+
- OAuth2: []
56+
- ApiKeyAuth: []
57+
- BasicAuth: []
58+
tags:
59+
- Discovery
60+
61+
components:
62+
securitySchemes:
63+
BearerAuth:
64+
type: http
65+
scheme: bearer
66+
bearerFormat: JWT
67+
description: Standard JWT Bearer Token authentication
68+
BasicAuth:
69+
type: http
70+
scheme: basic
71+
description: Basic HTTP authentication (username/password)
72+
ApiKeyAuth:
73+
type: apiKey
74+
in: header
75+
name: X-API-Key
76+
description: API key authentication via custom header
77+
OAuth2:
78+
type: oauth2
79+
description: OAuth2 authentication using authorization code flow
80+
flows:
81+
authorizationCode:
82+
authorizationUrl: https://example.com/oauth/authorize
83+
tokenUrl: https://example.com/oauth/token
84+
scopes:
85+
read: Read access to the agent
86+
write: Write access to the agent
87+
88+
schemas:
89+
AgentCard:
90+
type: object
91+
description: >
92+
Conveys key information about an A2A Server including its identity,
93+
service endpoints, capabilities, authentication requirements, and skills.
94+
required: [name, url, version, capabilities, skills]
95+
properties:
96+
name:
97+
type: string
98+
description: Human-readable name of the agent (e.g., "Recipe Advisor Agent")
99+
example: "Recipe Advisor Agent"
100+
description:
101+
type: string
102+
nullable: true
103+
description: >
104+
Human-readable description of the agent and its purpose.
105+
CommonMark MAY be used for rich text formatting.
106+
example: "This agent helps users find recipes, plan meals, and get cooking instructions."
107+
url:
108+
type: string
109+
format: uri
110+
description: >
111+
The base URL endpoint for the agent's A2A service.
112+
Must be an absolute HTTPS URL for production.
113+
example: "https://agent.example.com/a2a/api"
114+
provider:
115+
$ref: '#/components/schemas/AgentProvider'
116+
description: Information about the organization or entity providing the agent
117+
version:
118+
type: string
119+
description: >
120+
Version string for the agent or its A2A implementation.
121+
Format is defined by the provider (e.g., "1.0.0", "2023-10-26-beta").
122+
example: "1.0.0"
123+
documentationUrl:
124+
type: string
125+
format: uri
126+
nullable: true
127+
description: URL pointing to human-readable documentation for the agent
128+
example: "https://agent.example.com/docs"
129+
capabilities:
130+
$ref: '#/components/schemas/AgentCapabilities'
131+
description: Specifies optional A2A protocol features supported by this agent
132+
authentication:
133+
$ref: '#/components/schemas/AgentAuthentication'
134+
description: >
135+
Authentication schemes required to interact with the agent's endpoint.
136+
If null or omitted, no A2A-level authentication is explicitly advertised.
137+
defaultInputModes:
138+
type: array
139+
items:
140+
type: string
141+
description: >
142+
Array of MIME types the agent generally accepts as input across all skills,
143+
unless overridden by a specific skill. Defaults to ["text/plain"] if omitted.
144+
example: ["text/plain", "application/json"]
145+
defaultOutputModes:
146+
type: array
147+
items:
148+
type: string
149+
description: >
150+
Array of MIME types the agent generally produces as output across all skills,
151+
unless overridden by a specific skill. Defaults to ["text/plain"] if omitted.
152+
example: ["text/plain", "application/json"]
153+
skills:
154+
type: array
155+
items:
156+
$ref: '#/components/schemas/AgentSkill'
157+
description: >
158+
An array of specific skills or capabilities the agent offers.
159+
Must contain at least one skill if the agent is expected to perform actions.
160+
161+
AgentProvider:
162+
type: object
163+
description: Information about the organization or entity providing the agent
164+
required: [organization]
165+
properties:
166+
organization:
167+
type: string
168+
description: Name of the organization or entity
169+
example: "Example Corp"
170+
url:
171+
type: string
172+
format: uri
173+
nullable: true
174+
description: URL for the provider's organization website or relevant contact page
175+
example: "https://example.com"
176+
177+
AgentCapabilities:
178+
type: object
179+
description: Specifies optional A2A protocol features supported by the agent
180+
properties:
181+
streaming:
182+
type: boolean
183+
default: false
184+
description: >
185+
If true, the agent supports tasks/sendSubscribe and tasks/resubscribe
186+
for real-time updates via Server-Sent Events (SSE).
187+
pushNotifications:
188+
type: boolean
189+
default: false
190+
description: >
191+
If true, the agent supports tasks/pushNotification/set and tasks/pushNotification/get
192+
for asynchronous task updates via webhooks.
193+
stateTransitionHistory:
194+
type: boolean
195+
default: false
196+
description: >
197+
Placeholder for future feature: exposing detailed task status change history.
198+
199+
AgentAuthentication:
200+
type: object
201+
description: Describes the authentication requirements for accessing the agent's endpoint
202+
required: [schemes]
203+
properties:
204+
schemes:
205+
type: array
206+
items:
207+
type: string
208+
description: >
209+
Array of authentication scheme names supported/required by the agent's endpoint
210+
(e.g., "Bearer", "Basic", "OAuth2", "ApiKey").
211+
example: ["Bearer", "OAuth2"]
212+
credentials:
213+
type: string
214+
nullable: true
215+
description: >
216+
Optional non-secret, scheme-specific information.
217+
MUST NOT contain plaintext secrets (e.g., actual API key values, passwords).
218+
219+
AgentSkill:
220+
type: object
221+
description: Describes a specific capability or function the agent can perform
222+
required: [id, name]
223+
properties:
224+
id:
225+
type: string
226+
description: >
227+
Unique identifier for this skill within the context of this agent
228+
(e.g., "currency-converter", "generate-image-from-prompt").
229+
example: "recipe-finder"
230+
name:
231+
type: string
232+
description: Human-readable name of the skill
233+
example: "Recipe Finder"
234+
description:
235+
type: string
236+
nullable: true
237+
description: >
238+
Detailed description of what the skill does. CommonMark MAY be used for rich text.
239+
example: "Finds recipes based on ingredients and dietary restrictions"
240+
tags:
241+
type: array
242+
items:
243+
type: string
244+
nullable: true
245+
description: Array of keywords or categories for discoverability
246+
example: ["food", "cooking", "recipes"]
247+
examples:
248+
type: array
249+
items:
250+
type: string
251+
nullable: true
252+
description: Array of example prompts illustrating how to use this skill
253+
example: ["Find vegetarian pasta recipes", "Show me quick 30-minute meals"]
254+
inputModes:
255+
type: array
256+
items:
257+
type: string
258+
nullable: true
259+
description: >
260+
Overrides defaultInputModes for this specific skill. Accepted MIME types.
261+
example: ["text/plain", "application/json"]
262+
outputModes:
263+
type: array
264+
items:
265+
type: string
266+
nullable: true
267+
description: >
268+
Overrides defaultOutputModes for this specific skill. Produced MIME types.
269+
example: ["text/plain", "application/json"]

0 commit comments

Comments
 (0)