@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.
Files changed (131) hide show
  1. package/dist/enums.d.ts +0 -1
  2. package/dist/enums.d.ts.map +1 -1
  3. package/dist/enums.js +0 -1
  4. package/dist/enums.js.map +1 -1
  5. package/dist/errors.d.ts +0 -1
  6. package/dist/errors.d.ts.map +1 -1
  7. package/dist/errors.js +0 -1
  8. package/dist/errors.js.map +1 -1
  9. package/dist/index.d.ts +0 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +0 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/resources/contract-types.d.ts +0 -1
  14. package/dist/resources/contract-types.d.ts.map +1 -1
  15. package/dist/resources/contract-types.js +0 -3
  16. package/dist/resources/contract-types.js.map +1 -1
  17. package/dist/server.d.ts +0 -1
  18. package/dist/server.d.ts.map +1 -1
  19. package/dist/server.js +0 -1
  20. package/dist/server.js.map +1 -1
  21. package/dist/tool-scopes.d.ts +0 -12
  22. package/dist/tool-scopes.d.ts.map +1 -1
  23. package/dist/tool-scopes.js +19 -31
  24. package/dist/tool-scopes.js.map +1 -1
  25. package/dist/tools/a2a.d.ts +0 -1
  26. package/dist/tools/a2a.d.ts.map +1 -1
  27. package/dist/tools/a2a.js +21 -52
  28. package/dist/tools/a2a.js.map +1 -1
  29. package/dist/tools/agent-mandates.d.ts +0 -1
  30. package/dist/tools/agent-mandates.d.ts.map +1 -1
  31. package/dist/tools/agent-mandates.js +0 -10
  32. package/dist/tools/agent-mandates.js.map +1 -1
  33. package/dist/tools/agents-refs.d.ts +0 -1
  34. package/dist/tools/agents-refs.d.ts.map +1 -1
  35. package/dist/tools/agents-refs.js +0 -8
  36. package/dist/tools/agents-refs.js.map +1 -1
  37. package/dist/tools/capabilities.d.ts +0 -1
  38. package/dist/tools/capabilities.d.ts.map +1 -1
  39. package/dist/tools/capabilities.js +0 -3
  40. package/dist/tools/capabilities.js.map +1 -1
  41. package/dist/tools/code-mode.d.ts +0 -1
  42. package/dist/tools/code-mode.d.ts.map +1 -1
  43. package/dist/tools/code-mode.js +0 -9
  44. package/dist/tools/code-mode.js.map +1 -1
  45. package/dist/tools/compliance.d.ts +0 -1
  46. package/dist/tools/compliance.d.ts.map +1 -1
  47. package/dist/tools/compliance.js +0 -1
  48. package/dist/tools/compliance.js.map +1 -1
  49. package/dist/tools/dashboard.d.ts +0 -1
  50. package/dist/tools/dashboard.d.ts.map +1 -1
  51. package/dist/tools/dashboard.js +0 -1
  52. package/dist/tools/dashboard.js.map +1 -1
  53. package/dist/tools/disputes.d.ts +0 -1
  54. package/dist/tools/disputes.d.ts.map +1 -1
  55. package/dist/tools/disputes.js +0 -5
  56. package/dist/tools/disputes.js.map +1 -1
  57. package/dist/tools/enterprises.d.ts +0 -1
  58. package/dist/tools/enterprises.d.ts.map +1 -1
  59. package/dist/tools/enterprises.js +0 -7
  60. package/dist/tools/enterprises.js.map +1 -1
  61. package/dist/tools/events.d.ts +0 -1
  62. package/dist/tools/events.d.ts.map +1 -1
  63. package/dist/tools/events.js +0 -2
  64. package/dist/tools/events.js.map +1 -1
  65. package/dist/tools/federation-admin.d.ts +0 -1
  66. package/dist/tools/federation-admin.d.ts.map +1 -1
  67. package/dist/tools/federation-admin.js +0 -25
  68. package/dist/tools/federation-admin.js.map +1 -1
  69. package/dist/tools/federation.d.ts +0 -1
  70. package/dist/tools/federation.d.ts.map +1 -1
  71. package/dist/tools/federation.js +0 -21
  72. package/dist/tools/federation.js.map +1 -1
  73. package/dist/tools/health.d.ts +0 -1
  74. package/dist/tools/health.d.ts.map +1 -1
  75. package/dist/tools/health.js +0 -2
  76. package/dist/tools/health.js.map +1 -1
  77. package/dist/tools/mandates.d.ts +0 -1
  78. package/dist/tools/mandates.d.ts.map +1 -1
  79. package/dist/tools/mandates.js +0 -11
  80. package/dist/tools/mandates.js.map +1 -1
  81. package/dist/tools/openclaw.d.ts +0 -5
  82. package/dist/tools/openclaw.d.ts.map +1 -1
  83. package/dist/tools/openclaw.js +0 -5
  84. package/dist/tools/openclaw.js.map +1 -1
  85. package/dist/tools/receipts.d.ts +0 -1
  86. package/dist/tools/receipts.d.ts.map +1 -1
  87. package/dist/tools/receipts.js +3 -8
  88. package/dist/tools/receipts.js.map +1 -1
  89. package/dist/tools/reputation.d.ts +0 -1
  90. package/dist/tools/reputation.d.ts.map +1 -1
  91. package/dist/tools/reputation.js +0 -1
  92. package/dist/tools/reputation.js.map +1 -1
  93. package/dist/tools/schemas.d.ts +0 -1
  94. package/dist/tools/schemas.d.ts.map +1 -1
  95. package/dist/tools/schemas.js +0 -17
  96. package/dist/tools/schemas.js.map +1 -1
  97. package/dist/tools/verification-keys.d.ts +0 -1
  98. package/dist/tools/verification-keys.d.ts.map +1 -1
  99. package/dist/tools/verification-keys.js +0 -1
  100. package/dist/tools/verification-keys.js.map +1 -1
  101. package/dist/tools/verification.d.ts +0 -1
  102. package/dist/tools/verification.d.ts.map +1 -1
  103. package/dist/tools/verification.js +0 -3
  104. package/dist/tools/verification.js.map +1 -1
  105. package/package.json +2 -2
  106. package/src/enums.ts +0 -2
  107. package/src/errors.ts +0 -2
  108. package/src/index.ts +0 -2
  109. package/src/resources/contract-types.ts +0 -4
  110. package/src/server.ts +0 -2
  111. package/src/tool-scopes.ts +19 -32
  112. package/src/tools/a2a.ts +488 -520
  113. package/src/tools/agent-mandates.ts +0 -11
  114. package/src/tools/agents-refs.ts +0 -9
  115. package/src/tools/capabilities.ts +0 -4
  116. package/src/tools/code-mode.ts +0 -12
  117. package/src/tools/compliance.ts +0 -2
  118. package/src/tools/dashboard.ts +0 -2
  119. package/src/tools/disputes.ts +0 -6
  120. package/src/tools/enterprises.ts +0 -8
  121. package/src/tools/events.ts +0 -3
  122. package/src/tools/federation-admin.ts +0 -26
  123. package/src/tools/federation.ts +0 -22
  124. package/src/tools/health.ts +0 -3
  125. package/src/tools/mandates.ts +0 -12
  126. package/src/tools/openclaw.ts +0 -6
  127. package/src/tools/receipts.ts +161 -167
  128. package/src/tools/reputation.ts +0 -2
  129. package/src/tools/schemas.ts +0 -18
  130. package/src/tools/verification-keys.ts +0 -2
  131. package/src/tools/verification.ts +0 -4
@@ -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
  {
@@ -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';
@@ -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
- id: z.string().describe('Receipt UUID'),
12
- mandateId: z.string().describe('Associated mandate UUID'),
13
- agentId: z.string().describe('Agent that submitted the receipt'),
14
- status: ReceiptStatusEnum,
15
- evidence: z.record(z.string(), z.unknown()).describe('Evidence payload'),
16
- evidenceHash: z.string().nullable().optional().describe('SHA-256 hash of evidence'),
17
- notes: z.string().nullable().optional().describe('Human-readable notes'),
18
- verificationPhase: z.string().nullable().optional().describe('Current verification phase'),
19
- verificationResult: z.record(z.string(), z.unknown()).nullable().optional().describe('Verification result details'),
20
- validationErrors: z.array(z.string()).nullable().optional().describe('Validation errors if any'),
21
- idempotencyKey: z.string().nullable().optional().describe('Idempotency key for deduplication'),
22
- createdAt: z.string().describe('ISO 8601 creation timestamp'),
23
- updatedAt: z.string().nullable().optional().describe('ISO 8601 last update timestamp'),
24
- nextSteps: NextStepsField,
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
- data: z.array(ReceiptOutputSchema).describe('Array of receipts for the mandate'),
29
- nextCursor: z.string().nullable().optional().describe('Cursor for the next page (null if no more results)'),
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
- // --- submit_receipt ---
34
- mcp.registerTool(
35
- 'submit_receipt',
36
- {
37
- title: 'Submit Receipt',
38
- 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.',
39
- inputSchema: {
40
- mandateId: z.string().describe('UUID of the mandate this receipt is for'),
41
- agentId: z.string().describe('Agent ID submitting the receipt'),
42
- evidence: z.record(z.string(), z.unknown()).describe('Evidence JSON object proving task completion'),
43
- notes: z.string().optional().describe('Human-readable notes about the submission'),
44
- },
45
- outputSchema: ReceiptOutputSchema,
46
- annotations: {
47
- readOnlyHint: false,
48
- destructiveHint: false,
49
- idempotentHint: false,
50
- openWorldHint: true,
51
- },
52
- _meta: toolMeta('submit_receipt'),
53
- },
54
- async (args) => {
55
- try {
56
- const { mandateId, ...submitParams } = args;
57
- const receipt = await client.receipts.submit(mandateId, submitParams);
58
- let text = `✓ Receipt ${receipt.id} submitted for mandate ${mandateId}. Status: ${receipt.structuralValidation}.`;
59
- // Use denormalized mandateStatus from receipt response (no extra API call)
60
- const ms = receipt.mandateStatus;
61
- if (ms === 'FULFILLED') {
62
- text += '\n\n✅ Mandate settled to FULFILLED. Accountability loop closed.';
63
- } else if (ms === 'PROCESSING') {
64
- text += '\n\n⏳ Evidence is being verified. The principal will accept or reject.';
65
- }
66
- return {
67
- content: [{ type: 'text', text }],
68
- structuredContent: receipt as unknown as Record<string, unknown>,
69
- };
70
- } catch (err) {
71
- return apiErrorResult(err);
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
- // --- report_outcome (accept/reject receipt via principal verdict) ---
77
- mcp.registerTool(
78
- 'report_outcome',
79
- {
80
- title: 'Report Outcome',
81
- 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.',
82
- inputSchema: {
83
- mandateId: z.string().describe('UUID of the mandate'),
84
- receiptId: z.string().describe('UUID of the receipt to judge'),
85
- outcome: z.enum(['PASS', 'FAIL']).describe('Verdict: PASS (accept) or FAIL (reject)'),
86
- checks: z.record(z.string(), z.unknown()).optional().describe('Optional per-field check results'),
87
- },
88
- outputSchema: z.object({
89
- mandateId: z.string().describe('Mandate UUID'),
90
- receiptId: z.string().describe('Receipt UUID'),
91
- outcome: z.enum(['PASS', 'FAIL']).describe('Reported outcome'),
92
- signal: z.string().describe('Settlement signal: SETTLE, HOLD, or RELEASE'),
93
- reporterType: z.string().describe('Who reported: principal'),
94
- reportedAt: z.string().describe('ISO 8601 timestamp'),
95
- nextSteps: NextStepsField,
96
- }).passthrough().describe('Outcome result'),
97
- annotations: {
98
- readOnlyHint: false,
99
- destructiveHint: false,
100
- idempotentHint: true,
101
- openWorldHint: true,
102
- },
103
- _meta: toolMeta('report_outcome'),
104
- },
105
- async (args) => {
106
- try {
107
- const { mandateId, ...outcomeParams } = args;
108
- const result = await client.mandates.reportOutcome(mandateId, outcomeParams);
109
- const verb = result.outcome === 'PASS' ? 'accepted' : 'rejected';
110
- return {
111
- content: [{ type: 'text', text: `Receipt ${args.receiptId} ${verb}. Signal: ${result.signal}.` }],
112
- structuredContent: result as unknown as Record<string, unknown>,
113
- };
114
- } catch (err) {
115
- return apiErrorResult(err);
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
- // --- get_receipt ---
121
- mcp.registerTool(
122
- 'get_receipt',
123
- {
124
- title: 'Get Receipt',
125
- description: 'Get a specific receipt by ID. Use list_receipts to find receipt IDs first.',
126
- inputSchema: {
127
- mandateId: z.string().describe('UUID of the associated mandate'),
128
- receiptId: z.string().describe('UUID of the receipt to retrieve'),
129
- },
130
- outputSchema: ReceiptOutputSchema,
131
- annotations: {
132
- readOnlyHint: true,
133
- destructiveHint: false,
134
- idempotentHint: true,
135
- openWorldHint: true,
136
- },
137
- _meta: toolMeta('get_receipt'),
138
- },
139
- async (args) => {
140
- try {
141
- const receipt = await client.receipts.get(args.mandateId, args.receiptId);
142
- return {
143
- content: [{ type: 'text', text: `Receipt ${receipt.id}: status=${receipt.structuralValidation}, mandate=${receipt.mandateId}.` }],
144
- structuredContent: receipt as unknown as Record<string, unknown>,
145
- };
146
- } catch (err) {
147
- return apiErrorResult(err);
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
- // --- list_receipts ---
153
- mcp.registerTool(
154
- 'list_receipts',
155
- {
156
- title: 'List Receipts',
157
- description: 'List all receipts (task attestations) submitted against a mandate.',
158
- inputSchema: {
159
- mandateId: z.string().describe('UUID of the mandate to list receipts for'),
160
- limit: z.number().optional().describe('Page size (default: 20)'),
161
- offset: z.number().optional().describe('Page offset (default: 0)'),
162
- },
163
- outputSchema: ReceiptListOutputSchema,
164
- annotations: {
165
- readOnlyHint: true,
166
- destructiveHint: false,
167
- idempotentHint: true,
168
- openWorldHint: true,
169
- },
170
- _meta: toolMeta('list_receipts'),
171
- },
172
- async (args) => {
173
- try {
174
- const { mandateId, ...paginationParams } = args;
175
- const result = await client.receipts.list(mandateId, paginationParams);
176
- return {
177
- content: [{ type: 'text', text: `Found ${result.data.length} receipts for mandate ${mandateId}.` }],
178
- structuredContent: result as unknown as Record<string, unknown>,
179
- };
180
- } catch (err) {
181
- return apiErrorResult(err);
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
  }
@@ -1,5 +1,3 @@
1
- /** AGLedger™ — Reputation MCP 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';
@@ -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
  {