Skip to content

Commit e867f15

Browse files
Add PactSpec schema (AI agent capability declaration) (SchemaStore#5533)
* Add PactSpec schema (AI agent capability declaration) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 3c318a4 commit e867f15

4 files changed

Lines changed: 401 additions & 0 deletions

File tree

src/api/json/catalog.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5030,6 +5030,12 @@
50305030
"fileMatch": ["packer.json"],
50315031
"url": "https://www.schemastore.org/packer.json"
50325032
},
5033+
{
5034+
"name": "PactSpec",
5035+
"description": "AI agent capability declaration (pactspec.dev)",
5036+
"fileMatch": ["*.pactspec.json", "*.pactspec.yaml"],
5037+
"url": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/pactspec.json"
5038+
},
50335039
{
50345040
"name": "Paper paper-plugin.yml",
50355041
"description": "Paper Plugins YAML",

src/schemas/json/pactspec.json

Lines changed: 276 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,276 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://pactspec.dev/schema/v1.json",
4+
"title": "PactSpec v1",
5+
"description": "Machine-readable capability declaration for AI agents. Defines what an agent does, how to call it, what it costs, and how to test it. See https://pactspec.dev/spec for documentation.",
6+
"type": "object",
7+
"required": [
8+
"specVersion",
9+
"id",
10+
"name",
11+
"version",
12+
"provider",
13+
"endpoint",
14+
"skills"
15+
],
16+
"properties": {
17+
"specVersion": {
18+
"type": "string",
19+
"const": "1.0.0",
20+
"description": "PactSpec schema version. Always \"1.0.0\" for v1 specs."
21+
},
22+
"id": {
23+
"type": "string",
24+
"pattern": "^urn:pactspec:[a-z0-9-]+:[a-z0-9-]+$",
25+
"description": "Unique URN identifier, e.g. urn:pactspec:acme:invoice-processor"
26+
},
27+
"name": {
28+
"type": "string",
29+
"minLength": 1,
30+
"maxLength": 100,
31+
"description": "Human-readable agent name."
32+
},
33+
"version": {
34+
"type": "string",
35+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
36+
"description": "Semantic version of this agent, e.g. \"1.2.0\"."
37+
},
38+
"description": {
39+
"type": "string",
40+
"maxLength": 500,
41+
"description": "What this agent does."
42+
},
43+
"provider": {
44+
"type": "object",
45+
"description": "Who operates this agent.",
46+
"required": ["name"],
47+
"properties": {
48+
"name": {
49+
"type": "string",
50+
"description": "Organization or individual name."
51+
},
52+
"url": {
53+
"type": "string",
54+
"format": "uri",
55+
"description": "Provider's website."
56+
},
57+
"contact": {
58+
"type": "string",
59+
"format": "email",
60+
"description": "Contact email."
61+
}
62+
}
63+
},
64+
"endpoint": {
65+
"type": "object",
66+
"description": "Where to call this agent.",
67+
"required": ["url"],
68+
"properties": {
69+
"url": {
70+
"type": "string",
71+
"format": "uri",
72+
"description": "Agent endpoint URL."
73+
},
74+
"auth": {
75+
"type": "object",
76+
"description": "Authentication configuration.",
77+
"properties": {
78+
"type": {
79+
"type": "string",
80+
"enum": ["none", "bearer", "x-agent-id", "header"],
81+
"description": "Authentication method."
82+
},
83+
"header": {
84+
"type": "string",
85+
"description": "Custom header name when type is \"header\"."
86+
}
87+
}
88+
}
89+
}
90+
},
91+
"skills": {
92+
"type": "array",
93+
"minItems": 1,
94+
"description": "Capabilities this agent provides. Each skill has typed input/output schemas.",
95+
"items": {
96+
"type": "object",
97+
"required": [
98+
"id",
99+
"name",
100+
"description",
101+
"inputSchema",
102+
"outputSchema"
103+
],
104+
"properties": {
105+
"id": {
106+
"type": "string",
107+
"pattern": "^[a-z0-9-]+$",
108+
"description": "Skill identifier (lowercase, hyphens allowed)."
109+
},
110+
"name": {
111+
"type": "string",
112+
"description": "Human-readable skill name."
113+
},
114+
"description": {
115+
"type": "string",
116+
"description": "What this skill does."
117+
},
118+
"tags": {
119+
"type": "array",
120+
"items": { "type": "string" },
121+
"description": "Searchable tags."
122+
},
123+
"inputSchema": {
124+
"type": "object",
125+
"description": "JSON Schema for the skill's input."
126+
},
127+
"outputSchema": {
128+
"type": "object",
129+
"description": "JSON Schema for the skill's output."
130+
},
131+
"examples": {
132+
"type": "array",
133+
"description": "Example input/output pairs.",
134+
"items": {
135+
"type": "object",
136+
"required": ["input", "expectedOutput"],
137+
"properties": {
138+
"description": { "type": "string" },
139+
"input": { "description": "Example input value." },
140+
"expectedOutput": {
141+
"description": "Expected output for the example input."
142+
}
143+
}
144+
}
145+
},
146+
"pricing": {
147+
"type": "object",
148+
"description": "What this skill costs per invocation.",
149+
"required": ["model", "amount", "currency"],
150+
"properties": {
151+
"model": {
152+
"type": "string",
153+
"enum": ["per-invocation", "per-token", "per-second", "free"],
154+
"description": "Billing model."
155+
},
156+
"amount": {
157+
"type": "number",
158+
"minimum": 0,
159+
"description": "Price per unit."
160+
},
161+
"currency": {
162+
"type": "string",
163+
"enum": ["USD", "USDC", "SOL"],
164+
"description": "Currency."
165+
},
166+
"protocol": {
167+
"type": "string",
168+
"enum": ["x402", "stripe", "none"],
169+
"description": "Payment protocol."
170+
}
171+
}
172+
},
173+
"testSuite": {
174+
"type": "object",
175+
"description": "URL to a test suite that can be run against the live endpoint.",
176+
"required": ["url"],
177+
"properties": {
178+
"url": {
179+
"type": "string",
180+
"format": "uri",
181+
"description": "Test suite URL."
182+
},
183+
"type": {
184+
"type": "string",
185+
"enum": ["http-roundtrip", "json-schema-validation"],
186+
"description": "Test format."
187+
}
188+
}
189+
}
190+
}
191+
}
192+
},
193+
"tags": {
194+
"type": "array",
195+
"items": { "type": "string" },
196+
"description": "Searchable tags for the agent."
197+
},
198+
"license": { "type": "string", "description": "SPDX license identifier." },
199+
"links": {
200+
"type": "object",
201+
"description": "Related links.",
202+
"properties": {
203+
"documentation": {
204+
"type": "string",
205+
"format": "uri",
206+
"description": "Documentation URL."
207+
},
208+
"repository": {
209+
"type": "string",
210+
"format": "uri",
211+
"description": "Source code repository."
212+
}
213+
}
214+
},
215+
"delegation": {
216+
"type": "object",
217+
"description": "If this agent wraps another agent.",
218+
"properties": {
219+
"delegatedFrom": {
220+
"type": "string",
221+
"description": "Spec ID of the upstream agent being wrapped."
222+
},
223+
"terms": {
224+
"type": "string",
225+
"format": "uri",
226+
"description": "URL to delegation agreement."
227+
}
228+
}
229+
},
230+
"interop": {
231+
"type": "object",
232+
"description": "Interoperability with other protocols.",
233+
"properties": {
234+
"mcp": {
235+
"type": "object",
236+
"properties": {
237+
"serverUrl": {
238+
"type": "string",
239+
"format": "uri",
240+
"description": "MCP server endpoint."
241+
},
242+
"tools": {
243+
"type": "array",
244+
"items": { "type": "string" },
245+
"description": "MCP tool names."
246+
}
247+
}
248+
},
249+
"openapi": {
250+
"type": "object",
251+
"properties": {
252+
"specUrl": {
253+
"type": "string",
254+
"format": "uri",
255+
"description": "OpenAPI spec URL."
256+
}
257+
}
258+
},
259+
"acp": {
260+
"type": "object",
261+
"properties": {
262+
"supported": {
263+
"type": "boolean",
264+
"description": "Whether ACP sessions are supported."
265+
},
266+
"sessionTypes": {
267+
"type": "array",
268+
"items": { "type": "string" },
269+
"description": "Supported session types."
270+
}
271+
}
272+
}
273+
}
274+
}
275+
}
276+
}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"delegation": {
3+
"delegatedFrom": "urn:pactspec:upstream:ocr-engine",
4+
"terms": "https://acme.dev/delegation-terms"
5+
},
6+
"description": "Extracts line items and totals from invoice documents.",
7+
"endpoint": {
8+
"auth": { "type": "bearer" },
9+
"url": "https://api.acme.dev/agent"
10+
},
11+
"id": "urn:pactspec:acme:invoice-processor",
12+
"interop": {
13+
"mcp": {
14+
"serverUrl": "https://api.acme.dev/mcp",
15+
"tools": ["extract-line-items"]
16+
},
17+
"openapi": {
18+
"specUrl": "https://api.acme.dev/openapi.json"
19+
}
20+
},
21+
"license": "MIT",
22+
"links": {
23+
"documentation": "https://acme.dev/docs/invoice-processor",
24+
"repository": "https://github.com/acme/invoice-processor"
25+
},
26+
"name": "Invoice Processor",
27+
"provider": {
28+
"contact": "hello@acme.dev",
29+
"name": "Acme Corp",
30+
"url": "https://acme.dev"
31+
},
32+
"skills": [
33+
{
34+
"description": "Extracts structured line items from an invoice document.",
35+
"examples": [
36+
{
37+
"description": "Simple two-line invoice",
38+
"expectedOutput": {
39+
"lineItems": [
40+
{
41+
"description": "Widget A",
42+
"quantity": 10,
43+
"total": 50.0,
44+
"unitPrice": 5.0
45+
}
46+
]
47+
},
48+
"input": { "documentUrl": "https://acme.dev/samples/invoice-001.pdf" }
49+
}
50+
],
51+
"id": "extract-line-items",
52+
"inputSchema": {
53+
"properties": {
54+
"documentUrl": { "format": "uri", "type": "string" }
55+
},
56+
"required": ["documentUrl"],
57+
"type": "object"
58+
},
59+
"name": "Extract Line Items",
60+
"outputSchema": {
61+
"properties": {
62+
"lineItems": {
63+
"items": {
64+
"properties": {
65+
"description": { "type": "string" },
66+
"quantity": { "type": "number" },
67+
"total": { "type": "number" },
68+
"unitPrice": { "type": "number" }
69+
},
70+
"type": "object"
71+
},
72+
"type": "array"
73+
}
74+
},
75+
"required": ["lineItems"],
76+
"type": "object"
77+
},
78+
"pricing": {
79+
"amount": 0.05,
80+
"currency": "USD",
81+
"model": "per-invocation",
82+
"protocol": "stripe"
83+
},
84+
"tags": ["finance", "extraction"],
85+
"testSuite": {
86+
"type": "http-roundtrip",
87+
"url": "https://acme.dev/tests/extract-line-items.json"
88+
}
89+
}
90+
],
91+
"specVersion": "1.0.0",
92+
"tags": ["finance", "document-processing", "invoices"],
93+
"version": "2.1.0"
94+
}

0 commit comments

Comments
 (0)