-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopenapi.json
More file actions
523 lines (523 loc) · 16.7 KB
/
openapi.json
File metadata and controls
523 lines (523 loc) · 16.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
{
"openapi": "3.1.0",
"info": {
"title": "Open eXecution Protocol (OXP) Standard",
"version": "1.0.0",
"description": "A standard for calling tools (functions or services) in a distributed system.",
"license": {
"name": "MIT",
"url": "https://opensource.org/licenses/MIT"
},
"contact": {
"url": "https://openexecprotocol.org"
}
},
"paths": {
"/health": {
"get": {
"operationId": "health-check",
"summary": "Check health",
"description": "Checks the health status of the server.",
"security": [{}],
"responses": {
"200": {
"description": "Server is healthy."
},
"503": {
"description": "Server is unhealthy and cannot accept requests."
}
}
}
},
"/tools": {
"get": {
"operationId": "list-tools",
"summary": "List tools",
"description": "Returns a list of tool definitions.",
"security": [
{
"bearerAuth": []
},
{}
],
"requestBody": {
"required": false,
"content": {
"application/json": {
"schema": {
"properties": {
"$schema": {
"type": "string",
"format": "uri"
}
}
}
}
}
},
"responses": {
"200": {
"description": "A list of available tools.",
"content": {
"application/json": {
"schema": {
"properties": {
"$schema": {
"type": "string",
"format": "uri"
},
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ToolDefinition"
}
}
},
"required": ["items"]
}
}
}
},
"401": {
"description": "Unauthorized. The request requires authentication, but the provided credentials are invalid or missing."
}
}
}
},
"/tools/call": {
"post": {
"operationId": "call-tool",
"summary": "Call tool",
"description": "Calls a tool with the given parameters.",
"security": [
{
"bearerAuth": []
},
{}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"properties": {
"$schema": {
"type": "string",
"format": "uri"
},
"request": {
"$ref": "#/components/schemas/CallToolRequest"
}
},
"required": ["request"]
}
}
}
},
"responses": {
"200": {
"description": "Response from tool.",
"content": {
"application/json": {
"schema": {
"properties": {
"$schema": {
"type": "string",
"format": "uri"
},
"result": {
"$ref": "#/components/schemas/CallToolResponse"
}
},
"required": ["result"]
}
}
}
},
"400": {
"description": "The request is invalid or could not be processed.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServerErrorResponse"
}
}
}
},
"401": {
"description": "Unauthorized. The request requires authentication, but the provided credentials are invalid or missing."
},
"422": {
"description": "The tool call is valid, but the parameters are invalid (missing, incorrect type, etc).",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationErrorResponse"
}
}
}
}
}
}
}
},
"components": {
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
},
"schemas": {
"ToolId": {
"type": "string",
"description": "A tool's unique identifier in the format 'Toolkit.Tool[@version]', where @version is optional.",
"pattern": "^[A-Za-z0-9_]+\\.[A-Za-z0-9_]+(@([0-9]+|[0-9]+\\.[0-9]+\\.[0-9]+))?$",
"example": [
"Calculator.Add",
"Calculator.Add@1",
"Calculator.Add@1.0.0"
]
},
"ToolVersion": {
"type": "string",
"description": "A tool's semantic version in the format 'x.y.z', where x, y, and z are integers.",
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
"example": "1.2.3"
},
"ToolSecret": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The secret's unique identifier."
},
"value": {
"type": "string",
"description": "The secret's value."
}
},
"required": ["id", "value"],
"additionalProperties": true
},
"ToolDefinition": {
"type": "object",
"properties": {
"id": {
"$ref": "#/components/schemas/ToolId"
},
"name": {
"type": "string",
"description": "The tool's name. Only allows alphanumeric characters, underscores, and dashes.",
"pattern": "^[A-Za-z0-9_-]{1,64}$",
"example": ["Calculator_Add", "Email_GetEmails"]
},
"description": {
"type": "string",
"description": "A plain language explanation of when and how the tool should be used."
},
"version": {
"$ref": "#/components/schemas/ToolVersion"
},
"input_schema": {
"type": "object",
"additionalProperties": true,
"description": "JSON Schema describing the input parameters for the tool. Supports standard JSON Schema validation but excludes $ref and definitions/schemas for simplicity."
},
"output_schema": {
"oneOf": [
{
"type": "object",
"additionalProperties": true,
"description": "JSON Schema describing the output parameters for the tool. Supports standard JSON Schema validation but excludes $ref and definitions/schemas for simplicity."
},
{
"type": "null",
"description": "Null indicates the tool does not return any value."
}
],
"description": "Schema describing the output of the tool. Can be a JSON Schema object or null if the tool doesn't return a value."
},
"requirements": {
"type": "object",
"properties": {
"authorization": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "A provider's unique identifier, allowing the tool to specify a specific authorization provider."
},
"oauth2": {
"type": "object",
"description": "OAuth 2.0-specific authorization details.",
"properties": {
"scopes": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": true
}
}
},
"required": ["id"],
"additionalProperties": true
},
"secrets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The secret's unique identifier."
}
},
"required": ["id"],
"additionalProperties": true
}
},
"user_id": {
"type": "boolean",
"description": "Whether the tool requires a user ID."
}
},
"additionalProperties": true
}
},
"required": ["id", "name", "description", "version"],
"additionalProperties": false
},
"CallToolRequest": {
"type": "object",
"properties": {
"call_id": {
"type": "string",
"description": "A unique identifier (e.g. UUID) for this tool call. Used as an idempotency key. If omitted, the server will generate an ID."
},
"trace_id": {
"type": "string",
"description": "An optional trace identifier for the tool call."
},
"tool_id": {
"$ref": "#/components/schemas/ToolId"
},
"input": {
"type": "object",
"description": "The input parameters for the tool call.",
"additionalProperties": true
},
"context": {
"type": "object",
"properties": {
"authorization": {
"type": "array",
"description": "The authorization information for the tool call.",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The unique identifier for the authorization method or authorization provider."
},
"token": {
"type": "string",
"description": "The token for the tool call."
}
},
"required": ["id", "token"],
"additionalProperties": true
}
},
"secrets": {
"type": "array",
"description": "The secrets for the tool call.",
"items": {
"$ref": "#/components/schemas/ToolSecret"
},
"additionalProperties": true
},
"user_id": {
"type": "string",
"description": "A unique ID that identifies the user, if required by the tool."
}
},
"additionalProperties": true
}
},
"required": ["tool_id"],
"additionalProperties": false
},
"CallToolResponse": {
"type": "object",
"properties": {
"call_id": {
"type": "string",
"description": "The unique identifier (e.g. UUID) for this tool call. If an ID is not provided by the client, the server will generate one."
},
"duration": {
"type": "number",
"description": "The runtime duration of the tool call, in milliseconds"
},
"success": {
"type": "boolean",
"description": "Whether the tool call was successful. If the `error` field is present, this field will be false."
}
},
"required": ["call_id", "success"],
"oneOf": [
{
"properties": {
"success": { "enum": [true] },
"value": {
"type": [
"object",
"array",
"string",
"number",
"boolean",
"null"
],
"additionalProperties": true,
"description": "The value returned from the tool."
}
},
"not": { "required": ["error"] }
},
{
"properties": {
"success": { "enum": [false] },
"error": {
"$ref": "#/components/schemas/ToolError"
}
},
"required": ["error"],
"not": { "required": ["value"] }
}
],
"additionalProperties": false
},
"ServerErrorResponse": {
"type": "object",
"properties": {
"$schema": {
"type": "string",
"format": "uri"
},
"message": {
"type": "string",
"description": "The error message."
},
"developer_message": {
"type": "string",
"description": "An internal message that will be logged but will not be shown to the user or the AI model"
},
"missing_requirements": {
"type": "object",
"description": "A map of missing requirements.",
"properties": {
"authorization": {
"type": "array",
"description": "A list of authorization challenges that must be completed before the tool can be called.",
"items": {
"$ref": "#/components/schemas/ToolAuthorizationChallenge"
}
},
"user_id": {
"type": "boolean",
"description": "Whether the tool requires a user ID."
}
}
}
},
"required": ["message"],
"additionalProperties": true
},
"ValidationErrorResponse": {
"type": "object",
"properties": {
"$schema": {
"type": "string",
"format": "uri"
},
"message": {
"type": "string",
"description": "The error message."
},
"parameter_errors": {
"type": "object",
"description": "A map of parameter names to error messages, if parameter-level errors are present."
}
},
"required": ["message"],
"additionalProperties": true
},
"ToolAuthorizationChallenge": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The unique identifier for the authorization challenge."
},
"url": {
"type": "string",
"description": "The URL the user must visit to complete the authorization challenge."
},
"check_url": {
"type": "string",
"description": "The URL to check the status of the authorization challenge."
}
},
"required": ["id", "url"],
"additionalProperties": false
},
"AuthorizationChallengeCheckResponse": {
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "The status of the authorization challenge.",
"enum": ["pending", "completed", "failed"]
}
},
"required": ["status"],
"additionalProperties": true
},
"ToolError": {
"type": "object",
"description": "An error that occurred inside the tool function.",
"properties": {
"message": {
"type": "string",
"description": "An error message that can be shown to the user or the AI model."
},
"developer_message": {
"type": "string",
"description": "An internal message that will be logged but will not be shown to the user or the AI model."
},
"can_retry": {
"type": "boolean",
"description": "Whether the tool call can be retried by the client.",
"default": false
},
"additional_prompt_content": {
"type": "string",
"description": "Additional content to be included in the retry prompt."
},
"retry_after_ms": {
"type": "integer",
"description": "The number of milliseconds (if any) to wait before retrying the tool call."
}
},
"required": ["message"],
"additionalProperties": true
}
}
}
}