@agledger/mcp-server 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/enums.d.ts +0 -1
- package/dist/enums.d.ts.map +1 -1
- package/dist/enums.js +0 -1
- package/dist/enums.js.map +1 -1
- package/dist/errors.d.ts +0 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +0 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/resources/contract-types.d.ts +0 -1
- package/dist/resources/contract-types.d.ts.map +1 -1
- package/dist/resources/contract-types.js +0 -3
- package/dist/resources/contract-types.js.map +1 -1
- package/dist/server.d.ts +0 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +0 -1
- package/dist/server.js.map +1 -1
- package/dist/tool-scopes.d.ts +0 -12
- package/dist/tool-scopes.d.ts.map +1 -1
- package/dist/tool-scopes.js +19 -31
- package/dist/tool-scopes.js.map +1 -1
- package/dist/tools/a2a.d.ts +0 -1
- package/dist/tools/a2a.d.ts.map +1 -1
- package/dist/tools/a2a.js +21 -52
- package/dist/tools/a2a.js.map +1 -1
- package/dist/tools/agent-mandates.d.ts +0 -1
- package/dist/tools/agent-mandates.d.ts.map +1 -1
- package/dist/tools/agent-mandates.js +0 -10
- package/dist/tools/agent-mandates.js.map +1 -1
- package/dist/tools/agents-refs.d.ts +0 -1
- package/dist/tools/agents-refs.d.ts.map +1 -1
- package/dist/tools/agents-refs.js +0 -8
- package/dist/tools/agents-refs.js.map +1 -1
- package/dist/tools/capabilities.d.ts +0 -1
- package/dist/tools/capabilities.d.ts.map +1 -1
- package/dist/tools/capabilities.js +0 -3
- package/dist/tools/capabilities.js.map +1 -1
- package/dist/tools/code-mode.d.ts +0 -1
- package/dist/tools/code-mode.d.ts.map +1 -1
- package/dist/tools/code-mode.js +0 -9
- package/dist/tools/code-mode.js.map +1 -1
- package/dist/tools/compliance.d.ts +0 -1
- package/dist/tools/compliance.d.ts.map +1 -1
- package/dist/tools/compliance.js +0 -1
- package/dist/tools/compliance.js.map +1 -1
- package/dist/tools/dashboard.d.ts +0 -1
- package/dist/tools/dashboard.d.ts.map +1 -1
- package/dist/tools/dashboard.js +0 -1
- package/dist/tools/dashboard.js.map +1 -1
- package/dist/tools/disputes.d.ts +0 -1
- package/dist/tools/disputes.d.ts.map +1 -1
- package/dist/tools/disputes.js +0 -5
- package/dist/tools/disputes.js.map +1 -1
- package/dist/tools/enterprises.d.ts +0 -1
- package/dist/tools/enterprises.d.ts.map +1 -1
- package/dist/tools/enterprises.js +0 -7
- package/dist/tools/enterprises.js.map +1 -1
- package/dist/tools/events.d.ts +0 -1
- package/dist/tools/events.d.ts.map +1 -1
- package/dist/tools/events.js +0 -2
- package/dist/tools/events.js.map +1 -1
- package/dist/tools/federation-admin.d.ts +0 -1
- package/dist/tools/federation-admin.d.ts.map +1 -1
- package/dist/tools/federation-admin.js +0 -25
- package/dist/tools/federation-admin.js.map +1 -1
- package/dist/tools/federation.d.ts +0 -1
- package/dist/tools/federation.d.ts.map +1 -1
- package/dist/tools/federation.js +0 -21
- package/dist/tools/federation.js.map +1 -1
- package/dist/tools/health.d.ts +0 -1
- package/dist/tools/health.d.ts.map +1 -1
- package/dist/tools/health.js +0 -2
- package/dist/tools/health.js.map +1 -1
- package/dist/tools/mandates.d.ts +0 -1
- package/dist/tools/mandates.d.ts.map +1 -1
- package/dist/tools/mandates.js +0 -11
- package/dist/tools/mandates.js.map +1 -1
- package/dist/tools/openclaw.d.ts +0 -5
- package/dist/tools/openclaw.d.ts.map +1 -1
- package/dist/tools/openclaw.js +0 -5
- package/dist/tools/openclaw.js.map +1 -1
- package/dist/tools/receipts.d.ts +0 -1
- package/dist/tools/receipts.d.ts.map +1 -1
- package/dist/tools/receipts.js +3 -8
- package/dist/tools/receipts.js.map +1 -1
- package/dist/tools/reputation.d.ts +0 -1
- package/dist/tools/reputation.d.ts.map +1 -1
- package/dist/tools/reputation.js +0 -1
- package/dist/tools/reputation.js.map +1 -1
- package/dist/tools/schemas.d.ts +0 -1
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/schemas.js +0 -17
- package/dist/tools/schemas.js.map +1 -1
- package/dist/tools/verification-keys.d.ts +0 -1
- package/dist/tools/verification-keys.d.ts.map +1 -1
- package/dist/tools/verification-keys.js +0 -1
- package/dist/tools/verification-keys.js.map +1 -1
- package/dist/tools/verification.d.ts +0 -1
- package/dist/tools/verification.d.ts.map +1 -1
- package/dist/tools/verification.js +0 -3
- package/dist/tools/verification.js.map +1 -1
- package/package.json +2 -2
- package/src/enums.ts +0 -2
- package/src/errors.ts +0 -2
- package/src/index.ts +0 -2
- package/src/resources/contract-types.ts +0 -4
- package/src/server.ts +0 -2
- package/src/tool-scopes.ts +19 -32
- package/src/tools/a2a.ts +488 -520
- package/src/tools/agent-mandates.ts +0 -11
- package/src/tools/agents-refs.ts +0 -9
- package/src/tools/capabilities.ts +0 -4
- package/src/tools/code-mode.ts +0 -12
- package/src/tools/compliance.ts +0 -2
- package/src/tools/dashboard.ts +0 -2
- package/src/tools/disputes.ts +0 -6
- package/src/tools/enterprises.ts +0 -8
- package/src/tools/events.ts +0 -3
- package/src/tools/federation-admin.ts +0 -26
- package/src/tools/federation.ts +0 -22
- package/src/tools/health.ts +0 -3
- package/src/tools/mandates.ts +0 -12
- package/src/tools/openclaw.ts +0 -6
- package/src/tools/receipts.ts +161 -167
- package/src/tools/reputation.ts +0 -2
- package/src/tools/schemas.ts +0 -18
- package/src/tools/verification-keys.ts +0 -2
- package/src/tools/verification.ts +0 -4
package/src/tools/mandates.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** AGLedger™ — Mandate MCP tools (create, get, search, activate, cancel, delegate). Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved. */
|
|
2
|
-
|
|
3
1
|
import { z } from 'zod';
|
|
4
2
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
3
|
import type { AgledgerClient } from '@agledger/sdk';
|
|
@@ -46,7 +44,6 @@ const SearchResultOutputSchema = z.object({
|
|
|
46
44
|
}).describe('Paginated mandate search results');
|
|
47
45
|
|
|
48
46
|
export function registerMandateTools(mcp: McpServer, client: AgledgerClient): void {
|
|
49
|
-
// --- create_mandate ---
|
|
50
47
|
mcp.registerTool(
|
|
51
48
|
'create_mandate',
|
|
52
49
|
{
|
|
@@ -91,7 +88,6 @@ export function registerMandateTools(mcp: McpServer, client: AgledgerClient): vo
|
|
|
91
88
|
},
|
|
92
89
|
);
|
|
93
90
|
|
|
94
|
-
// --- get_mandate ---
|
|
95
91
|
mcp.registerTool(
|
|
96
92
|
'get_mandate',
|
|
97
93
|
{
|
|
@@ -122,7 +118,6 @@ export function registerMandateTools(mcp: McpServer, client: AgledgerClient): vo
|
|
|
122
118
|
},
|
|
123
119
|
);
|
|
124
120
|
|
|
125
|
-
// --- search_mandates ---
|
|
126
121
|
mcp.registerTool(
|
|
127
122
|
'search_mandates',
|
|
128
123
|
{
|
|
@@ -162,7 +157,6 @@ export function registerMandateTools(mcp: McpServer, client: AgledgerClient): vo
|
|
|
162
157
|
},
|
|
163
158
|
);
|
|
164
159
|
|
|
165
|
-
// --- activate_mandate ---
|
|
166
160
|
mcp.registerTool(
|
|
167
161
|
'activate_mandate',
|
|
168
162
|
{
|
|
@@ -193,7 +187,6 @@ export function registerMandateTools(mcp: McpServer, client: AgledgerClient): vo
|
|
|
193
187
|
},
|
|
194
188
|
);
|
|
195
189
|
|
|
196
|
-
// --- cancel_mandate ---
|
|
197
190
|
mcp.registerTool(
|
|
198
191
|
'cancel_mandate',
|
|
199
192
|
{
|
|
@@ -225,7 +218,6 @@ export function registerMandateTools(mcp: McpServer, client: AgledgerClient): vo
|
|
|
225
218
|
},
|
|
226
219
|
);
|
|
227
220
|
|
|
228
|
-
// --- update_mandate ---
|
|
229
221
|
mcp.registerTool(
|
|
230
222
|
'update_mandate',
|
|
231
223
|
{
|
|
@@ -257,7 +249,6 @@ export function registerMandateTools(mcp: McpServer, client: AgledgerClient): vo
|
|
|
257
249
|
},
|
|
258
250
|
);
|
|
259
251
|
|
|
260
|
-
// --- request_revision ---
|
|
261
252
|
mcp.registerTool(
|
|
262
253
|
'request_revision',
|
|
263
254
|
{
|
|
@@ -289,7 +280,6 @@ export function registerMandateTools(mcp: McpServer, client: AgledgerClient): vo
|
|
|
289
280
|
},
|
|
290
281
|
);
|
|
291
282
|
|
|
292
|
-
// --- delegate_mandate ---
|
|
293
283
|
mcp.registerTool(
|
|
294
284
|
'delegate_mandate',
|
|
295
285
|
{
|
|
@@ -332,7 +322,6 @@ export function registerMandateTools(mcp: McpServer, client: AgledgerClient): vo
|
|
|
332
322
|
},
|
|
333
323
|
);
|
|
334
324
|
|
|
335
|
-
// --- get_mandate_graph ---
|
|
336
325
|
mcp.registerTool(
|
|
337
326
|
'get_mandate_graph',
|
|
338
327
|
{
|
|
@@ -364,7 +353,6 @@ export function registerMandateTools(mcp: McpServer, client: AgledgerClient): vo
|
|
|
364
353
|
},
|
|
365
354
|
);
|
|
366
355
|
|
|
367
|
-
// --- get_mandate_summary ---
|
|
368
356
|
mcp.registerTool(
|
|
369
357
|
'get_mandate_summary',
|
|
370
358
|
{
|
package/src/tools/openclaw.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AGLedger™ — OpenClaw tool profile (5 thin tools for agent-to-agent notarization).
|
|
3
|
-
* Optimized for minimal token overhead (<500 tokens total schema).
|
|
4
|
-
* Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
import { z } from 'zod';
|
|
8
2
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
9
3
|
import type { AgledgerClient } from '@agledger/sdk';
|
package/src/tools/receipts.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** AGLedger™ — Receipt MCP tools (submit, accept, reject, list). Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved. */
|
|
2
|
-
|
|
3
1
|
import { z } from 'zod';
|
|
4
2
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
3
|
import type { AgledgerClient } from '@agledger/sdk';
|
|
@@ -8,178 +6,174 @@ import { NextStepsField, ReceiptStatusEnum } from '../enums.js';
|
|
|
8
6
|
import { toolMeta } from '../tool-scopes.js';
|
|
9
7
|
|
|
10
8
|
const ReceiptOutputSchema = z.object({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
id: z.string().describe('Receipt UUID'),
|
|
10
|
+
mandateId: z.string().describe('Associated mandate UUID'),
|
|
11
|
+
agentId: z.string().describe('Agent that submitted the receipt'),
|
|
12
|
+
status: ReceiptStatusEnum,
|
|
13
|
+
evidence: z.record(z.string(), z.unknown()).describe('Evidence payload'),
|
|
14
|
+
evidenceHash: z.string().nullable().optional().describe('SHA-256 hash of evidence'),
|
|
15
|
+
notes: z.string().nullable().optional().describe('Human-readable notes'),
|
|
16
|
+
verificationPhase: z.string().nullable().optional().describe('Current verification phase'),
|
|
17
|
+
verificationResult: z.record(z.string(), z.unknown()).nullable().optional().describe('Verification result details'),
|
|
18
|
+
validationErrors: z.array(z.string()).nullable().optional().describe('Validation errors if any'),
|
|
19
|
+
idempotencyKey: z.string().nullable().optional().describe('Idempotency key for deduplication'),
|
|
20
|
+
createdAt: z.string().describe('ISO 8601 creation timestamp'),
|
|
21
|
+
updatedAt: z.string().nullable().optional().describe('ISO 8601 last update timestamp'),
|
|
22
|
+
nextSteps: NextStepsField,
|
|
25
23
|
}).passthrough().describe('AGLedger receipt (task attestation) object');
|
|
26
24
|
|
|
27
25
|
const ReceiptListOutputSchema = z.object({
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
data: z.array(ReceiptOutputSchema).describe('Array of receipts for the mandate'),
|
|
27
|
+
nextCursor: z.string().nullable().optional().describe('Cursor for the next page (null if no more results)'),
|
|
30
28
|
}).passthrough().describe('List of receipts for a mandate');
|
|
31
29
|
|
|
32
30
|
export function registerReceiptTools(mcp: McpServer, client: AgledgerClient): void {
|
|
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
|
-
);
|
|
31
|
+
mcp.registerTool(
|
|
32
|
+
'submit_receipt',
|
|
33
|
+
{
|
|
34
|
+
title: 'Submit Receipt',
|
|
35
|
+
description: 'Submit a task attestation (receipt) with evidence against a mandate. REQUIRED to close the accountability loop — do NOT skip this step after completing work.',
|
|
36
|
+
inputSchema: {
|
|
37
|
+
mandateId: z.string().describe('UUID of the mandate this receipt is for'),
|
|
38
|
+
agentId: z.string().describe('Agent ID submitting the receipt'),
|
|
39
|
+
evidence: z.record(z.string(), z.unknown()).describe('Evidence JSON object proving task completion'),
|
|
40
|
+
notes: z.string().optional().describe('Human-readable notes about the submission'),
|
|
41
|
+
},
|
|
42
|
+
outputSchema: ReceiptOutputSchema,
|
|
43
|
+
annotations: {
|
|
44
|
+
readOnlyHint: false,
|
|
45
|
+
destructiveHint: false,
|
|
46
|
+
idempotentHint: false,
|
|
47
|
+
openWorldHint: true,
|
|
48
|
+
},
|
|
49
|
+
_meta: toolMeta('submit_receipt'),
|
|
50
|
+
},
|
|
51
|
+
async (args) => {
|
|
52
|
+
try {
|
|
53
|
+
const { mandateId, ...submitParams } = args;
|
|
54
|
+
const receipt = await client.receipts.submit(mandateId, submitParams);
|
|
55
|
+
let text = ` Receipt ${receipt.id} submitted for mandate ${mandateId}. Status: ${receipt.structuralValidation}.`;
|
|
56
|
+
// Use denormalized mandateStatus from receipt response (no extra API call)
|
|
57
|
+
const ms = receipt.mandateStatus;
|
|
58
|
+
if (ms === 'FULFILLED') {
|
|
59
|
+
text += '\n\n Mandate settled to FULFILLED. Accountability loop closed.';
|
|
60
|
+
} else if (ms === 'PROCESSING') {
|
|
61
|
+
text += '\n\n Evidence is being verified. The principal will accept or reject.';
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
content: [{ type: 'text', text }],
|
|
65
|
+
structuredContent: receipt as unknown as Record<string, unknown>,
|
|
66
|
+
};
|
|
67
|
+
} catch (err) {
|
|
68
|
+
return apiErrorResult(err);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
);
|
|
75
72
|
|
|
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
|
-
);
|
|
73
|
+
mcp.registerTool(
|
|
74
|
+
'report_outcome',
|
|
75
|
+
{
|
|
76
|
+
title: 'Report Outcome',
|
|
77
|
+
description: 'Report the principal verdict (PASS or FAIL) on a receipt. PASS accepts the receipt; FAIL rejects it. This is the standard way to close the accountability loop.',
|
|
78
|
+
inputSchema: {
|
|
79
|
+
mandateId: z.string().describe('UUID of the mandate'),
|
|
80
|
+
receiptId: z.string().describe('UUID of the receipt to judge'),
|
|
81
|
+
outcome: z.enum(['PASS', 'FAIL']).describe('Verdict: PASS (accept) or FAIL (reject)'),
|
|
82
|
+
checks: z.record(z.string(), z.unknown()).optional().describe('Optional per-field check results'),
|
|
83
|
+
},
|
|
84
|
+
outputSchema: z.object({
|
|
85
|
+
mandateId: z.string().describe('Mandate UUID'),
|
|
86
|
+
receiptId: z.string().describe('Receipt UUID'),
|
|
87
|
+
outcome: z.enum(['PASS', 'FAIL']).describe('Reported outcome'),
|
|
88
|
+
signal: z.string().describe('Settlement signal: SETTLE, HOLD, or RELEASE'),
|
|
89
|
+
reporterType: z.string().describe('Who reported: principal'),
|
|
90
|
+
reportedAt: z.string().describe('ISO 8601 timestamp'),
|
|
91
|
+
nextSteps: NextStepsField,
|
|
92
|
+
}).passthrough().describe('Outcome result'),
|
|
93
|
+
annotations: {
|
|
94
|
+
readOnlyHint: false,
|
|
95
|
+
destructiveHint: false,
|
|
96
|
+
idempotentHint: true,
|
|
97
|
+
openWorldHint: true,
|
|
98
|
+
},
|
|
99
|
+
_meta: toolMeta('report_outcome'),
|
|
100
|
+
},
|
|
101
|
+
async (args) => {
|
|
102
|
+
try {
|
|
103
|
+
const { mandateId, ...outcomeParams } = args;
|
|
104
|
+
const result = await client.mandates.reportOutcome(mandateId, outcomeParams);
|
|
105
|
+
const verb = result.outcome === 'PASS' ? 'accepted' : 'rejected';
|
|
106
|
+
return {
|
|
107
|
+
content: [{ type: 'text', text: `Receipt ${args.receiptId} ${verb}. Signal: ${result.signal}.` }],
|
|
108
|
+
structuredContent: result as unknown as Record<string, unknown>,
|
|
109
|
+
};
|
|
110
|
+
} catch (err) {
|
|
111
|
+
return apiErrorResult(err);
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
);
|
|
119
115
|
|
|
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
|
-
);
|
|
116
|
+
mcp.registerTool(
|
|
117
|
+
'get_receipt',
|
|
118
|
+
{
|
|
119
|
+
title: 'Get Receipt',
|
|
120
|
+
description: 'Get a specific receipt by ID. Use list_receipts to find receipt IDs first.',
|
|
121
|
+
inputSchema: {
|
|
122
|
+
mandateId: z.string().describe('UUID of the associated mandate'),
|
|
123
|
+
receiptId: z.string().describe('UUID of the receipt to retrieve'),
|
|
124
|
+
},
|
|
125
|
+
outputSchema: ReceiptOutputSchema,
|
|
126
|
+
annotations: {
|
|
127
|
+
readOnlyHint: true,
|
|
128
|
+
destructiveHint: false,
|
|
129
|
+
idempotentHint: true,
|
|
130
|
+
openWorldHint: true,
|
|
131
|
+
},
|
|
132
|
+
_meta: toolMeta('get_receipt'),
|
|
133
|
+
},
|
|
134
|
+
async (args) => {
|
|
135
|
+
try {
|
|
136
|
+
const receipt = await client.receipts.get(args.mandateId, args.receiptId);
|
|
137
|
+
return {
|
|
138
|
+
content: [{ type: 'text', text: `Receipt ${receipt.id}: status=${receipt.structuralValidation}, mandate=${receipt.mandateId}.` }],
|
|
139
|
+
structuredContent: receipt as unknown as Record<string, unknown>,
|
|
140
|
+
};
|
|
141
|
+
} catch (err) {
|
|
142
|
+
return apiErrorResult(err);
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
);
|
|
151
146
|
|
|
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
|
-
);
|
|
147
|
+
mcp.registerTool(
|
|
148
|
+
'list_receipts',
|
|
149
|
+
{
|
|
150
|
+
title: 'List Receipts',
|
|
151
|
+
description: 'List all receipts (task attestations) submitted against a mandate.',
|
|
152
|
+
inputSchema: {
|
|
153
|
+
mandateId: z.string().describe('UUID of the mandate to list receipts for'),
|
|
154
|
+
limit: z.number().optional().describe('Page size (default: 20)'),
|
|
155
|
+
offset: z.number().optional().describe('Page offset (default: 0)'),
|
|
156
|
+
},
|
|
157
|
+
outputSchema: ReceiptListOutputSchema,
|
|
158
|
+
annotations: {
|
|
159
|
+
readOnlyHint: true,
|
|
160
|
+
destructiveHint: false,
|
|
161
|
+
idempotentHint: true,
|
|
162
|
+
openWorldHint: true,
|
|
163
|
+
},
|
|
164
|
+
_meta: toolMeta('list_receipts'),
|
|
165
|
+
},
|
|
166
|
+
async (args) => {
|
|
167
|
+
try {
|
|
168
|
+
const { mandateId, ...paginationParams } = args;
|
|
169
|
+
const result = await client.receipts.list(mandateId, paginationParams);
|
|
170
|
+
return {
|
|
171
|
+
content: [{ type: 'text', text: `Found ${result.data.length} receipts for mandate ${mandateId}.` }],
|
|
172
|
+
structuredContent: result as unknown as Record<string, unknown>,
|
|
173
|
+
};
|
|
174
|
+
} catch (err) {
|
|
175
|
+
return apiErrorResult(err);
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
);
|
|
185
179
|
}
|
package/src/tools/reputation.ts
CHANGED
package/src/tools/schemas.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** AGLedger™ — Schema MCP tools (list, get, and schema development tools). Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved. */
|
|
2
|
-
|
|
3
1
|
import { z } from 'zod';
|
|
4
2
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
3
|
import type { AgledgerClient } from '@agledger/sdk';
|
|
@@ -133,7 +131,6 @@ const CompatibilityModeEnum = z.enum(['FULL', 'BACKWARD', 'FORWARD', 'NONE'])
|
|
|
133
131
|
.describe('Schema compatibility mode');
|
|
134
132
|
|
|
135
133
|
export function registerSchemaTools(mcp: McpServer, client: AgledgerClient): void {
|
|
136
|
-
// --- list_contract_schemas ---
|
|
137
134
|
mcp.registerTool(
|
|
138
135
|
'list_contract_schemas',
|
|
139
136
|
{
|
|
@@ -162,7 +159,6 @@ export function registerSchemaTools(mcp: McpServer, client: AgledgerClient): voi
|
|
|
162
159
|
},
|
|
163
160
|
);
|
|
164
161
|
|
|
165
|
-
// --- get_contract_schema ---
|
|
166
162
|
mcp.registerTool(
|
|
167
163
|
'get_contract_schema',
|
|
168
164
|
{
|
|
@@ -193,7 +189,6 @@ export function registerSchemaTools(mcp: McpServer, client: AgledgerClient): voi
|
|
|
193
189
|
},
|
|
194
190
|
);
|
|
195
191
|
|
|
196
|
-
// --- get_meta_schema ---
|
|
197
192
|
mcp.registerTool(
|
|
198
193
|
'get_meta_schema',
|
|
199
194
|
{
|
|
@@ -222,7 +217,6 @@ export function registerSchemaTools(mcp: McpServer, client: AgledgerClient): voi
|
|
|
222
217
|
},
|
|
223
218
|
);
|
|
224
219
|
|
|
225
|
-
// --- preview_schema ---
|
|
226
220
|
mcp.registerTool(
|
|
227
221
|
'preview_schema',
|
|
228
222
|
{
|
|
@@ -272,7 +266,6 @@ export function registerSchemaTools(mcp: McpServer, client: AgledgerClient): voi
|
|
|
272
266
|
},
|
|
273
267
|
);
|
|
274
268
|
|
|
275
|
-
// --- register_schema ---
|
|
276
269
|
mcp.registerTool(
|
|
277
270
|
'register_schema',
|
|
278
271
|
{
|
|
@@ -319,7 +312,6 @@ export function registerSchemaTools(mcp: McpServer, client: AgledgerClient): voi
|
|
|
319
312
|
},
|
|
320
313
|
);
|
|
321
314
|
|
|
322
|
-
// --- get_schema_versions ---
|
|
323
315
|
mcp.registerTool(
|
|
324
316
|
'get_schema_versions',
|
|
325
317
|
{
|
|
@@ -353,7 +345,6 @@ export function registerSchemaTools(mcp: McpServer, client: AgledgerClient): voi
|
|
|
353
345
|
},
|
|
354
346
|
);
|
|
355
347
|
|
|
356
|
-
// --- diff_schema_versions ---
|
|
357
348
|
mcp.registerTool(
|
|
358
349
|
'diff_schema_versions',
|
|
359
350
|
{
|
|
@@ -392,7 +383,6 @@ export function registerSchemaTools(mcp: McpServer, client: AgledgerClient): voi
|
|
|
392
383
|
},
|
|
393
384
|
);
|
|
394
385
|
|
|
395
|
-
// --- get_schema_template ---
|
|
396
386
|
mcp.registerTool(
|
|
397
387
|
'get_schema_template',
|
|
398
388
|
{
|
|
@@ -422,7 +412,6 @@ export function registerSchemaTools(mcp: McpServer, client: AgledgerClient): voi
|
|
|
422
412
|
},
|
|
423
413
|
);
|
|
424
414
|
|
|
425
|
-
// --- get_blank_schema_template ---
|
|
426
415
|
mcp.registerTool(
|
|
427
416
|
'get_blank_schema_template',
|
|
428
417
|
{
|
|
@@ -450,7 +439,6 @@ export function registerSchemaTools(mcp: McpServer, client: AgledgerClient): voi
|
|
|
450
439
|
},
|
|
451
440
|
);
|
|
452
441
|
|
|
453
|
-
// --- check_schema_compatibility ---
|
|
454
442
|
mcp.registerTool(
|
|
455
443
|
'check_schema_compatibility',
|
|
456
444
|
{
|
|
@@ -485,7 +473,6 @@ export function registerSchemaTools(mcp: McpServer, client: AgledgerClient): voi
|
|
|
485
473
|
},
|
|
486
474
|
);
|
|
487
475
|
|
|
488
|
-
// --- get_schema_version ---
|
|
489
476
|
mcp.registerTool(
|
|
490
477
|
'get_schema_version',
|
|
491
478
|
{
|
|
@@ -520,7 +507,6 @@ export function registerSchemaTools(mcp: McpServer, client: AgledgerClient): voi
|
|
|
520
507
|
},
|
|
521
508
|
);
|
|
522
509
|
|
|
523
|
-
// --- validate_receipt_schema ---
|
|
524
510
|
mcp.registerTool(
|
|
525
511
|
'validate_receipt_schema',
|
|
526
512
|
{
|
|
@@ -562,7 +548,6 @@ export function registerSchemaTools(mcp: McpServer, client: AgledgerClient): voi
|
|
|
562
548
|
},
|
|
563
549
|
);
|
|
564
550
|
|
|
565
|
-
// --- get_schema_rules ---
|
|
566
551
|
mcp.registerTool(
|
|
567
552
|
'get_schema_rules',
|
|
568
553
|
{
|
|
@@ -593,7 +578,6 @@ export function registerSchemaTools(mcp: McpServer, client: AgledgerClient): voi
|
|
|
593
578
|
},
|
|
594
579
|
);
|
|
595
580
|
|
|
596
|
-
// --- delete_schema ---
|
|
597
581
|
mcp.registerTool(
|
|
598
582
|
'delete_schema',
|
|
599
583
|
{
|
|
@@ -623,7 +607,6 @@ export function registerSchemaTools(mcp: McpServer, client: AgledgerClient): voi
|
|
|
623
607
|
},
|
|
624
608
|
);
|
|
625
609
|
|
|
626
|
-
// --- export_schema ---
|
|
627
610
|
mcp.registerTool(
|
|
628
611
|
'export_schema',
|
|
629
612
|
{
|
|
@@ -653,7 +636,6 @@ export function registerSchemaTools(mcp: McpServer, client: AgledgerClient): voi
|
|
|
653
636
|
},
|
|
654
637
|
);
|
|
655
638
|
|
|
656
|
-
// --- import_schema ---
|
|
657
639
|
mcp.registerTool(
|
|
658
640
|
'import_schema',
|
|
659
641
|
{
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** AGLedger™ — Verification keys MCP tool. Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved. */
|
|
2
|
-
|
|
3
1
|
import { z } from 'zod';
|
|
4
2
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
3
|
import type { AgledgerClient } from '@agledger/sdk';
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** AGLedger™ — Verification MCP tools (verify mandate, get verification status). Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved. */
|
|
2
|
-
|
|
3
1
|
import { z } from 'zod';
|
|
4
2
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
3
|
import type { AgledgerClient } from '@agledger/sdk';
|
|
@@ -25,7 +23,6 @@ const VerificationStatusOutputSchema = z.object({
|
|
|
25
23
|
}).passthrough().describe('Current verification status for a mandate');
|
|
26
24
|
|
|
27
25
|
export function registerVerificationTools(mcp: McpServer, client: AgledgerClient): void {
|
|
28
|
-
// --- verify_mandate ---
|
|
29
26
|
mcp.registerTool(
|
|
30
27
|
'verify_mandate',
|
|
31
28
|
{
|
|
@@ -56,7 +53,6 @@ export function registerVerificationTools(mcp: McpServer, client: AgledgerClient
|
|
|
56
53
|
},
|
|
57
54
|
);
|
|
58
55
|
|
|
59
|
-
// --- get_verification_status ---
|
|
60
56
|
mcp.registerTool(
|
|
61
57
|
'get_verification_status',
|
|
62
58
|
{
|