@agledger/mcp-server 1.4.3 → 1.5.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 (119) hide show
  1. package/dist/index.d.ts.map +1 -1
  2. package/dist/index.js +0 -2
  3. package/dist/index.js.map +1 -1
  4. package/dist/server.d.ts +2 -2
  5. package/dist/server.d.ts.map +1 -1
  6. package/dist/server.js +1 -3
  7. package/dist/server.js.map +1 -1
  8. package/dist/tool-scopes.d.ts.map +1 -1
  9. package/dist/tool-scopes.js +0 -3
  10. package/dist/tool-scopes.js.map +1 -1
  11. package/dist/tools/a2a.d.ts.map +1 -1
  12. package/dist/tools/a2a.js +20 -220
  13. package/dist/tools/a2a.js.map +1 -1
  14. package/dist/tools/agent-mandates.d.ts.map +1 -1
  15. package/dist/tools/agent-mandates.js +10 -74
  16. package/dist/tools/agent-mandates.js.map +1 -1
  17. package/dist/tools/agents-refs.d.ts.map +1 -1
  18. package/dist/tools/agents-refs.js +9 -61
  19. package/dist/tools/agents-refs.js.map +1 -1
  20. package/dist/tools/capabilities.d.ts.map +1 -1
  21. package/dist/tools/capabilities.js +2 -14
  22. package/dist/tools/capabilities.js.map +1 -1
  23. package/dist/tools/code-mode.d.ts.map +1 -1
  24. package/dist/tools/code-mode.js +4 -35
  25. package/dist/tools/code-mode.js.map +1 -1
  26. package/dist/tools/compliance.d.ts.map +1 -1
  27. package/dist/tools/compliance.js +3 -37
  28. package/dist/tools/compliance.js.map +1 -1
  29. package/dist/tools/dashboard.d.ts.map +1 -1
  30. package/dist/tools/dashboard.js +3 -37
  31. package/dist/tools/dashboard.js.map +1 -1
  32. package/dist/tools/disputes.d.ts.map +1 -1
  33. package/dist/tools/disputes.js +4 -41
  34. package/dist/tools/disputes.js.map +1 -1
  35. package/dist/tools/enterprises.d.ts.map +1 -1
  36. package/dist/tools/enterprises.js +6 -62
  37. package/dist/tools/enterprises.js.map +1 -1
  38. package/dist/tools/events.d.ts.map +1 -1
  39. package/dist/tools/events.js +1 -19
  40. package/dist/tools/events.js.map +1 -1
  41. package/dist/tools/federation-admin.d.ts.map +1 -1
  42. package/dist/tools/federation-admin.js +24 -256
  43. package/dist/tools/federation-admin.js.map +1 -1
  44. package/dist/tools/federation.d.ts.map +1 -1
  45. package/dist/tools/federation.js +20 -197
  46. package/dist/tools/federation.js.map +1 -1
  47. package/dist/tools/health.d.ts.map +1 -1
  48. package/dist/tools/health.js +1 -13
  49. package/dist/tools/health.js.map +1 -1
  50. package/dist/tools/mandates.d.ts.map +1 -1
  51. package/dist/tools/mandates.js +10 -93
  52. package/dist/tools/mandates.js.map +1 -1
  53. package/dist/tools/openclaw.d.ts.map +1 -1
  54. package/dist/tools/openclaw.js +5 -32
  55. package/dist/tools/openclaw.js.map +1 -1
  56. package/dist/tools/receipts.d.ts.map +1 -1
  57. package/dist/tools/receipts.js +4 -94
  58. package/dist/tools/receipts.js.map +1 -1
  59. package/dist/tools/reputation.d.ts.map +1 -1
  60. package/dist/tools/reputation.js +3 -33
  61. package/dist/tools/reputation.js.map +1 -1
  62. package/dist/tools/schemas.d.ts.map +1 -1
  63. package/dist/tools/schemas.js +16 -186
  64. package/dist/tools/schemas.js.map +1 -1
  65. package/dist/tools/verification-keys.d.ts.map +1 -1
  66. package/dist/tools/verification-keys.js +1 -22
  67. package/dist/tools/verification-keys.js.map +1 -1
  68. package/dist/tools/verification.d.ts.map +1 -1
  69. package/dist/tools/verification.js +2 -27
  70. package/dist/tools/verification.js.map +1 -1
  71. package/package.json +1 -1
  72. package/src/index.ts +1 -3
  73. package/src/server.ts +3 -5
  74. package/src/tool-scopes.ts +0 -4
  75. package/src/tools/a2a.ts +20 -233
  76. package/src/tools/agent-mandates.ts +10 -76
  77. package/src/tools/agents-refs.ts +9 -65
  78. package/src/tools/capabilities.ts +2 -15
  79. package/src/tools/compliance.ts +3 -37
  80. package/src/tools/dashboard.ts +3 -37
  81. package/src/tools/disputes.ts +4 -42
  82. package/src/tools/enterprises.ts +6 -62
  83. package/src/tools/events.ts +1 -20
  84. package/src/tools/federation-admin.ts +24 -281
  85. package/src/tools/federation.ts +20 -217
  86. package/src/tools/health.ts +1 -14
  87. package/src/tools/mandates.ts +10 -95
  88. package/src/tools/openclaw.ts +5 -51
  89. package/src/tools/receipts.ts +4 -95
  90. package/src/tools/reputation.ts +3 -34
  91. package/src/tools/schemas.ts +16 -194
  92. package/src/tools/verification-keys.ts +1 -24
  93. package/src/tools/verification.ts +2 -29
  94. package/tests/conformance.test.ts +4 -26
  95. package/tests/conformance.ts +3 -13
  96. package/tests/profiles.test.ts +2 -17
  97. package/tests/tools/a2a.test.ts +0 -28
  98. package/tests/tools/agent-mandates.test.ts +0 -10
  99. package/tests/tools/agents-refs.test.ts +0 -9
  100. package/tests/tools/capabilities.test.ts +0 -6
  101. package/tests/tools/compliance.test.ts +0 -8
  102. package/tests/tools/dashboard.test.ts +0 -9
  103. package/tests/tools/disputes.test.ts +0 -8
  104. package/tests/tools/enterprises.test.ts +0 -10
  105. package/tests/tools/events.test.ts +0 -5
  106. package/tests/tools/federation-admin.test.ts +0 -41
  107. package/tests/tools/federation.test.ts +0 -34
  108. package/tests/tools/health.test.ts +1 -12
  109. package/tests/tools/mandates.test.ts +0 -12
  110. package/tests/tools/openclaw.test.ts +0 -12
  111. package/tests/tools/receipts.test.ts +1 -14
  112. package/tests/tools/reputation.test.ts +0 -9
  113. package/tests/tools/schemas.test.ts +0 -23
  114. package/tests/tools/verification-keys.test.ts +0 -6
  115. package/tests/tools/verification.test.ts +1 -11
  116. package/src/tools/code-mode.ts +0 -461
  117. package/tests/drift/code-mode-manifest.test.ts +0 -144
  118. package/tests/integration/output-schema-validation.test.ts +0 -167
  119. package/tests/tools/code-mode.test.ts +0 -168
@@ -6,167 +6,6 @@ import { toolMeta } from '../tool-scopes.js';
6
6
  import { HubStateEnum, GatewayStatusEnum } from '../enums.js';
7
7
  import type { FederationAuditEntryType } from '@agledger/sdk';
8
8
 
9
- const RegistrationTokenOutputSchema = z.object({
10
- token: z.string().describe('Registration token string'),
11
- label: z.string().optional().describe('Human-readable label for the token'),
12
- expiresAt: z.string().optional().describe('ISO 8601 expiration timestamp'),
13
- allowedContractTypes: z.array(z.string()).optional().describe('Contract types this token permits'),
14
- createdAt: z.string().describe('ISO 8601 creation timestamp'),
15
- }).passthrough().describe('Federation registration token');
16
-
17
- const GatewayOutputSchema = z.object({
18
- id: z.string().describe('Gateway UUID'),
19
- name: z.string().optional().describe('Gateway display name'),
20
- status: z.string().describe('Gateway status (active, suspended, revoked)'),
21
- createdAt: z.string().describe('ISO 8601 creation timestamp'),
22
- updatedAt: z.string().optional().describe('ISO 8601 last update timestamp'),
23
- }).passthrough().describe('Federation gateway object');
24
-
25
- const GatewayListOutputSchema = z.object({
26
- gateways: z.array(GatewayOutputSchema).describe('List of federation gateways'),
27
- total: z.number().optional().describe('Total number of gateways matching the query'),
28
- }).passthrough().describe('Paginated list of federation gateways');
29
-
30
- const FederationMandateOutputSchema = z.object({
31
- id: z.string().describe('Federation mandate UUID'),
32
- gatewayId: z.string().describe('Originating gateway UUID'),
33
- hubState: z.string().describe('Hub-side mandate state'),
34
- contractType: z.string().optional().describe('Contract type identifier'),
35
- createdAt: z.string().describe('ISO 8601 creation timestamp'),
36
- }).passthrough().describe('Federation mandate object');
37
-
38
- const FederationMandateListOutputSchema = z.object({
39
- mandates: z.array(FederationMandateOutputSchema).describe('List of federation mandates'),
40
- total: z.number().optional().describe('Total number of mandates matching the query'),
41
- }).passthrough().describe('Paginated list of federation mandates');
42
-
43
- const AuditLogEntrySchema = z.object({
44
- id: z.string().describe('Audit log entry UUID'),
45
- gatewayId: z.string().optional().describe('Gateway UUID associated with the entry'),
46
- entryType: z.string().describe('Type of audit log entry'),
47
- mandateId: z.string().optional().describe('Associated mandate UUID'),
48
- timestamp: z.string().describe('ISO 8601 timestamp of the entry'),
49
- details: z.record(z.string(), z.unknown()).optional().describe('Entry-specific details'),
50
- }).passthrough().describe('Federation audit log entry');
51
-
52
- const AuditLogOutputSchema = z.object({
53
- entries: z.array(AuditLogEntrySchema).describe('List of audit log entries'),
54
- total: z.number().optional().describe('Total number of entries matching the query'),
55
- }).passthrough().describe('Paginated federation audit log');
56
-
57
- const FederationHealthOutputSchema = z.object({
58
- status: z.string().describe('Overall federation health status'),
59
- activeGateways: z.number().optional().describe('Number of active gateways'),
60
- pendingMandates: z.number().optional().describe('Number of pending federation mandates'),
61
- dlqDepth: z.number().optional().describe('Number of entries in the dead letter queue'),
62
- timestamp: z.string().describe('ISO 8601 timestamp of the health check'),
63
- }).passthrough().describe('Federation health summary');
64
-
65
- const SequenceResetOutputSchema = z.object({
66
- gatewayId: z.string().describe('Gateway UUID'),
67
- previousSeq: z.number().optional().describe('Previous sequence number'),
68
- newSeq: z.number().describe('New sequence number after reset'),
69
- }).passthrough().describe('Sequence reset result');
70
-
71
- const DlqEntrySchema = z.object({
72
- id: z.string().describe('DLQ entry UUID'),
73
- payload: z.record(z.string(), z.unknown()).optional().describe('Original message payload'),
74
- error: z.string().optional().describe('Error that caused the entry to be dead-lettered'),
75
- createdAt: z.string().describe('ISO 8601 timestamp when the entry was dead-lettered'),
76
- retryCount: z.number().optional().describe('Number of retry attempts'),
77
- }).passthrough().describe('Dead letter queue entry');
78
-
79
- const DlqListOutputSchema = z.object({
80
- entries: z.array(DlqEntrySchema).describe('List of DLQ entries'),
81
- cursor: z.string().optional().describe('Cursor for the next page of results'),
82
- }).passthrough().describe('Paginated dead letter queue entries');
83
-
84
- const DlqRetryOutputSchema = z.object({
85
- dlqId: z.string().describe('DLQ entry UUID that was retried'),
86
- status: z.string().describe('Result of the retry attempt'),
87
- }).passthrough().describe('DLQ retry result');
88
-
89
- const DlqDeleteOutputSchema = z.object({
90
- dlqId: z.string().describe('DLQ entry UUID that was deleted'),
91
- deleted: z.boolean().describe('Whether the entry was successfully deleted'),
92
- }).passthrough().describe('DLQ deletion result');
93
-
94
- const RevokeOutputSchema = z.object({
95
- gatewayId: z.string().describe('Revoked gateway UUID'),
96
- status: z.string().describe('New gateway status after revocation'),
97
- revokedAt: z.string().optional().describe('ISO 8601 revocation timestamp'),
98
- }).passthrough().describe('Gateway revocation result');
99
-
100
- const HubKeyOutputSchema = z.object({
101
- keyId: z.string().optional().describe('New hub signing key UUID'),
102
- publicKey: z.string().optional().describe('New Ed25519 public key (base64)'),
103
- status: z.string().optional().describe('Key status (pending, active, expired)'),
104
- createdAt: z.string().optional().describe('ISO 8601 creation timestamp'),
105
- }).passthrough().describe('Hub signing key rotation result');
106
-
107
- const HubKeyListOutputSchema = z.object({
108
- keys: z.array(z.object({
109
- keyId: z.string().describe('Hub key UUID'),
110
- status: z.string().describe('Key status (pending, active, expired)'),
111
- createdAt: z.string().describe('ISO 8601 creation timestamp'),
112
- }).passthrough()).optional().describe('List of hub signing keys'),
113
- }).passthrough().describe('Hub signing key list');
114
-
115
- const HubKeyActionOutputSchema = z.object({
116
- keyId: z.string().describe('Hub key UUID'),
117
- status: z.string().optional().describe('New key status'),
118
- }).passthrough().describe('Hub key action result');
119
-
120
- const PeerOutputSchema = z.object({
121
- hubId: z.string().optional().describe('Peer hub UUID'),
122
- name: z.string().optional().describe('Peer hub name'),
123
- endpoint: z.string().optional().describe('Peer hub API endpoint'),
124
- status: z.string().optional().describe('Peer connection status'),
125
- lastSyncAt: z.string().optional().describe('ISO 8601 last sync timestamp'),
126
- }).passthrough().describe('Peer federation hub');
127
-
128
- const PeerListOutputSchema = z.object({
129
- peers: z.array(PeerOutputSchema).optional().describe('List of peer hubs'),
130
- }).passthrough().describe('List of peer federation hubs');
131
-
132
- const PeerActionOutputSchema = z.object({
133
- hubId: z.string().describe('Peer hub UUID'),
134
- status: z.string().optional().describe('Action result status'),
135
- }).passthrough().describe('Peer hub action result');
136
-
137
- const PeeringTokenOutputSchema = z.object({
138
- token: z.string().optional().describe('One-time peering token'),
139
- expiresAt: z.string().optional().describe('ISO 8601 token expiry'),
140
- }).passthrough().describe('Peering token for cross-hub registration');
141
-
142
- const SchemaVersionDeleteOutputSchema = z.object({
143
- contractType: z.string().describe('Contract type identifier'),
144
- version: z.string().describe('Deleted schema version'),
145
- deleted: z.boolean().optional().describe('Whether the version was deleted'),
146
- }).passthrough().describe('Schema version deletion result');
147
-
148
- const ReputationContributionListOutputSchema = z.object({
149
- contributions: z.array(z.object({
150
- agentId: z.string().describe('Federated agent ID'),
151
- contractType: z.string().describe('Contract type'),
152
- outcome: z.string().describe('Mandate outcome'),
153
- gatewayId: z.string().optional().describe('Contributing gateway ID'),
154
- timestamp: z.string().optional().describe('ISO 8601 contribution timestamp'),
155
- }).passthrough()).optional().describe('List of reputation contributions'),
156
- }).passthrough().describe('Reputation contributions for an agent');
157
-
158
- const ReputationResetOutputSchema = z.object({
159
- agentId: z.string().describe('Federated agent ID'),
160
- reset: z.boolean().optional().describe('Whether the reputation was reset'),
161
- }).passthrough().describe('Reputation reset result');
162
-
163
- const MandateCriteriaStatusOutputSchema = z.object({
164
- mandateId: z.string().describe('Federation mandate ID'),
165
- status: z.string().optional().describe('Criteria exchange status'),
166
- principalSubmitted: z.boolean().optional().describe('Whether the principal has submitted criteria'),
167
- performerAcknowledged: z.boolean().optional().describe('Whether the performer has acknowledged criteria'),
168
- }).passthrough().describe('Cross-boundary criteria exchange status');
169
-
170
9
  export function registerFederationAdminTools(mcp: McpServer, client: AgledgerClient): void {
171
10
  mcp.registerTool(
172
11
  'federation_create_token',
@@ -178,7 +17,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
178
17
  expiresInHours: z.number().optional().describe('Hours until the token expires'),
179
18
  allowedContractTypes: z.array(z.string()).optional().describe('Contract types this token permits'),
180
19
  },
181
- outputSchema: RegistrationTokenOutputSchema,
182
20
  annotations: {
183
21
  readOnlyHint: false,
184
22
  destructiveHint: false,
@@ -194,10 +32,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
194
32
  expiresInHours: args.expiresInHours,
195
33
  allowedContractTypes: args.allowedContractTypes,
196
34
  });
197
- return {
198
- content: [{ type: 'text', text: `Registration token created. Expires: ${result.expiresAt}.` }],
199
- structuredContent: toStructuredContent(result),
200
- };
35
+ return { content: [], structuredContent: toStructuredContent(result) };
201
36
  } catch (err) {
202
37
  return apiErrorResult(err);
203
38
  }
@@ -214,7 +49,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
214
49
  limit: z.number().optional().describe('Maximum number of results to return'),
215
50
  offset: z.number().optional().describe('Number of results to skip for pagination'),
216
51
  },
217
- outputSchema: GatewayListOutputSchema,
218
52
  annotations: {
219
53
  readOnlyHint: true,
220
54
  destructiveHint: false,
@@ -230,10 +64,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
230
64
  limit: args.limit,
231
65
  offset: args.offset,
232
66
  });
233
- return {
234
- content: [{ type: 'text', text: `Found ${result.data.length} gateway(s).${result.total != null ? ` Total: ${result.total}.` : ''}` }],
235
- structuredContent: toStructuredContent(result),
236
- };
67
+ return { content: [], structuredContent: toStructuredContent(result) };
237
68
  } catch (err) {
238
69
  return apiErrorResult(err);
239
70
  }
@@ -249,7 +80,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
249
80
  gatewayId: z.string().describe('UUID of the gateway to revoke'),
250
81
  reason: z.string().describe('Reason for revocation (recorded in audit log)'),
251
82
  },
252
- outputSchema: RevokeOutputSchema,
253
83
  annotations: {
254
84
  readOnlyHint: false,
255
85
  destructiveHint: true,
@@ -261,10 +91,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
261
91
  async (args) => {
262
92
  try {
263
93
  const result = await client.federationAdmin.revokeGateway(args.gatewayId, { reason: args.reason });
264
- return {
265
- content: [{ type: 'text', text: `Gateway ${args.gatewayId} revoked. Reason: ${args.reason}.` }],
266
- structuredContent: toStructuredContent(result),
267
- };
94
+ return { content: [], structuredContent: toStructuredContent(result) };
268
95
  } catch (err) {
269
96
  return apiErrorResult(err);
270
97
  }
@@ -283,7 +110,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
283
110
  limit: z.number().optional().describe('Maximum number of results to return'),
284
111
  offset: z.number().optional().describe('Number of results to skip for pagination'),
285
112
  },
286
- outputSchema: FederationMandateListOutputSchema,
287
113
  annotations: {
288
114
  readOnlyHint: true,
289
115
  destructiveHint: false,
@@ -301,10 +127,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
301
127
  limit: args.limit,
302
128
  offset: args.offset,
303
129
  });
304
- return {
305
- content: [{ type: 'text', text: `Found ${result.data.length} federation mandate(s).${result.total != null ? ` Total: ${result.total}.` : ''}` }],
306
- structuredContent: toStructuredContent(result),
307
- };
130
+ return { content: [], structuredContent: toStructuredContent(result) };
308
131
  } catch (err) {
309
132
  return apiErrorResult(err);
310
133
  }
@@ -323,7 +146,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
323
146
  limit: z.number().optional().describe('Maximum number of results to return'),
324
147
  offset: z.number().optional().describe('Number of results to skip for pagination'),
325
148
  },
326
- outputSchema: AuditLogOutputSchema,
327
149
  annotations: {
328
150
  readOnlyHint: true,
329
151
  destructiveHint: false,
@@ -341,10 +163,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
341
163
  limit: args.limit,
342
164
  offset: args.offset,
343
165
  });
344
- return {
345
- content: [{ type: 'text', text: `Retrieved ${result.data.length} audit log entry(ies).${result.total != null ? ` Total: ${result.total}.` : ''}` }],
346
- structuredContent: toStructuredContent(result),
347
- };
166
+ return { content: [], structuredContent: toStructuredContent(result) };
348
167
  } catch (err) {
349
168
  return apiErrorResult(err);
350
169
  }
@@ -357,7 +176,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
357
176
  title: 'Federation Health Summary',
358
177
  description: 'Get the overall federation health summary, including active gateway count, pending mandates, and DLQ depth.',
359
178
  inputSchema: {},
360
- outputSchema: FederationHealthOutputSchema,
361
179
  annotations: {
362
180
  readOnlyHint: true,
363
181
  destructiveHint: false,
@@ -369,10 +187,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
369
187
  async () => {
370
188
  try {
371
189
  const result = await client.federationAdmin.getHealth();
372
- return {
373
- content: [{ type: 'text', text: `Federation health: ${result.gateways.active} active gateways, ${result.gateways.suspended} suspended, ${result.gateways.revoked} revoked. Audit chain length: ${result.auditChainLength}.` }],
374
- structuredContent: toStructuredContent(result),
375
- };
190
+ return { content: [], structuredContent: toStructuredContent(result) };
376
191
  } catch (err) {
377
192
  return apiErrorResult(err);
378
193
  }
@@ -388,7 +203,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
388
203
  gatewayId: z.string().describe('UUID of the gateway whose sequence to reset'),
389
204
  newSeq: z.number().optional().describe('New sequence number (defaults to server-determined value if omitted)'),
390
205
  },
391
- outputSchema: SequenceResetOutputSchema,
392
206
  annotations: {
393
207
  readOnlyHint: false,
394
208
  destructiveHint: true,
@@ -400,10 +214,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
400
214
  async (args) => {
401
215
  try {
402
216
  const result = await client.federationAdmin.resetSequence(args.gatewayId, { newSeq: args.newSeq });
403
- return {
404
- content: [{ type: 'text', text: `Sequence reset for gateway ${args.gatewayId}: ${result.reset ? 'success' : 'failed'}.` }],
405
- structuredContent: toStructuredContent(result),
406
- };
217
+ return { content: [], structuredContent: toStructuredContent(result) };
407
218
  } catch (err) {
408
219
  return apiErrorResult(err);
409
220
  }
@@ -419,7 +230,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
419
230
  limit: z.number().optional().describe('Maximum number of results to return'),
420
231
  cursor: z.string().optional().describe('Cursor for the next page of results'),
421
232
  },
422
- outputSchema: DlqListOutputSchema,
423
233
  annotations: {
424
234
  readOnlyHint: true,
425
235
  destructiveHint: false,
@@ -434,10 +244,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
434
244
  limit: args.limit,
435
245
  cursor: args.cursor,
436
246
  });
437
- return {
438
- content: [{ type: 'text', text: `Found ${result.data.length} DLQ entry(ies).${result.hasMore ? ' More available.' : ''}` }],
439
- structuredContent: toStructuredContent(result),
440
- };
247
+ return { content: [], structuredContent: toStructuredContent(result) };
441
248
  } catch (err) {
442
249
  return apiErrorResult(err);
443
250
  }
@@ -452,7 +259,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
452
259
  inputSchema: {
453
260
  dlqId: z.string().describe('UUID of the DLQ entry to retry'),
454
261
  },
455
- outputSchema: DlqRetryOutputSchema,
456
262
  annotations: {
457
263
  readOnlyHint: false,
458
264
  destructiveHint: false,
@@ -464,10 +270,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
464
270
  async (args) => {
465
271
  try {
466
272
  const result = await client.federationAdmin.retryDlq(args.dlqId);
467
- return {
468
- content: [{ type: 'text', text: `DLQ entry ${args.dlqId} retried: ${result.retried ? 'success' : 'failed'}.` }],
469
- structuredContent: toStructuredContent(result),
470
- };
273
+ return { content: [], structuredContent: toStructuredContent(result) };
471
274
  } catch (err) {
472
275
  return apiErrorResult(err);
473
276
  }
@@ -482,7 +285,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
482
285
  inputSchema: {
483
286
  dlqId: z.string().describe('UUID of the DLQ entry to delete'),
484
287
  },
485
- outputSchema: DlqDeleteOutputSchema,
486
288
  annotations: {
487
289
  readOnlyHint: false,
488
290
  destructiveHint: true,
@@ -494,10 +296,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
494
296
  async (args) => {
495
297
  try {
496
298
  const result = await client.federationAdmin.deleteDlq(args.dlqId);
497
- return {
498
- content: [{ type: 'text', text: `DLQ entry ${args.dlqId} deleted.` }],
499
- structuredContent: toStructuredContent(result),
500
- };
299
+ return { content: [], structuredContent: toStructuredContent(result) };
501
300
  } catch (err) {
502
301
  return apiErrorResult(err);
503
302
  }
@@ -510,7 +309,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
510
309
  title: 'Rotate Hub Signing Key',
511
310
  description: 'Rotate the federation hub signing key. This is destructive — generates a new key pair and transitions gateways to use it. Old key remains valid until explicitly expired via federation_expire_hub_key.',
512
311
  inputSchema: {},
513
- outputSchema: HubKeyOutputSchema,
514
312
  annotations: {
515
313
  readOnlyHint: false,
516
314
  destructiveHint: true,
@@ -522,10 +320,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
522
320
  async () => {
523
321
  try {
524
322
  const result = await client.federationAdmin.rotateHubKey();
525
- return {
526
- content: [{ type: 'text', text: `Hub key rotated. New key ID: ${result.id}. Use federation_activate_hub_key to make it active.` }],
527
- structuredContent: toStructuredContent(result),
528
- };
323
+ return { content: [], structuredContent: toStructuredContent(result) };
529
324
  } catch (err) {
530
325
  return apiErrorResult(err);
531
326
  }
@@ -538,7 +333,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
538
333
  title: 'List Hub Signing Keys',
539
334
  description: 'List all hub signing keys including active, pending, and expired keys. Use this to audit key rotation history and identify which key is currently active.',
540
335
  inputSchema: {},
541
- outputSchema: HubKeyListOutputSchema,
542
336
  annotations: {
543
337
  readOnlyHint: true,
544
338
  destructiveHint: false,
@@ -550,10 +344,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
550
344
  async () => {
551
345
  try {
552
346
  const result = await client.federationAdmin.listHubKeys();
553
- return {
554
- content: [{ type: 'text', text: `Found ${Array.isArray(result) ? result.length : 0} hub signing key(s).` }],
555
- structuredContent: toStructuredContent({ keys: result }),
556
- };
347
+ return { content: [], structuredContent: toStructuredContent({ keys: result }) };
557
348
  } catch (err) {
558
349
  return apiErrorResult(err);
559
350
  }
@@ -568,7 +359,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
568
359
  inputSchema: {
569
360
  keyId: z.string().describe('UUID of the hub key to activate'),
570
361
  },
571
- outputSchema: HubKeyActionOutputSchema,
572
362
  annotations: {
573
363
  readOnlyHint: false,
574
364
  destructiveHint: false,
@@ -580,10 +370,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
580
370
  async (args) => {
581
371
  try {
582
372
  const result = await client.federationAdmin.activateHubKey(args.keyId);
583
- return {
584
- content: [{ type: 'text', text: `Hub key ${args.keyId} activated. All gateways will now use this key for signature verification.` }],
585
- structuredContent: toStructuredContent(result),
586
- };
373
+ return { content: [], structuredContent: toStructuredContent(result) };
587
374
  } catch (err) {
588
375
  return apiErrorResult(err);
589
376
  }
@@ -598,7 +385,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
598
385
  inputSchema: {
599
386
  keyId: z.string().describe('UUID of the hub key to expire'),
600
387
  },
601
- outputSchema: HubKeyActionOutputSchema,
602
388
  annotations: {
603
389
  readOnlyHint: false,
604
390
  destructiveHint: false,
@@ -610,10 +396,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
610
396
  async (args) => {
611
397
  try {
612
398
  const result = await client.federationAdmin.expireHubKey(args.keyId);
613
- return {
614
- content: [{ type: 'text', text: `Hub key ${args.keyId} expired. It will no longer be accepted for signature verification.` }],
615
- structuredContent: toStructuredContent(result),
616
- };
399
+ return { content: [], structuredContent: toStructuredContent(result) };
617
400
  } catch (err) {
618
401
  return apiErrorResult(err);
619
402
  }
@@ -631,7 +414,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
631
414
  publicKey: z.string().describe('Peer hub Ed25519 public key (base64)'),
632
415
  peeringToken: z.string().describe('One-time peering token from the peer hub'),
633
416
  },
634
- outputSchema: PeerOutputSchema,
635
417
  annotations: {
636
418
  readOnlyHint: false,
637
419
  destructiveHint: false,
@@ -643,10 +425,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
643
425
  async (args) => {
644
426
  try {
645
427
  const result = await client.federationAdmin.registerPeer(args);
646
- return {
647
- content: [{ type: 'text', text: `Peer hub "${args.name}" registered. Hub ID: ${result.hubId ?? 'n/a'}. Use federation_resync_peer to synchronize state.` }],
648
- structuredContent: toStructuredContent(result),
649
- };
428
+ return { content: [], structuredContent: toStructuredContent(result) };
650
429
  } catch (err) {
651
430
  return apiErrorResult(err);
652
431
  }
@@ -659,7 +438,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
659
438
  title: 'List Peer Hubs',
660
439
  description: 'List all registered peer federation hubs. Shows connection status and last sync timestamp for each peer.',
661
440
  inputSchema: {},
662
- outputSchema: PeerListOutputSchema,
663
441
  annotations: {
664
442
  readOnlyHint: true,
665
443
  destructiveHint: false,
@@ -671,10 +449,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
671
449
  async () => {
672
450
  try {
673
451
  const result = await client.federationAdmin.listPeers();
674
- return {
675
- content: [{ type: 'text', text: `Found ${result.data.length} peer hub(s).` }],
676
- structuredContent: toStructuredContent(result),
677
- };
452
+ return { content: [], structuredContent: toStructuredContent(result) };
678
453
  } catch (err) {
679
454
  return apiErrorResult(err);
680
455
  }
@@ -689,7 +464,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
689
464
  inputSchema: {
690
465
  hubId: z.string().describe('Peer hub UUID'),
691
466
  },
692
- outputSchema: PeerOutputSchema,
693
467
  annotations: {
694
468
  readOnlyHint: true,
695
469
  destructiveHint: false,
@@ -701,10 +475,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
701
475
  async (args) => {
702
476
  try {
703
477
  const result = await client.federationAdmin.getPeer(args.hubId);
704
- return {
705
- content: [{ type: 'text', text: `Peer hub ${args.hubId}: ${result.name ?? 'unnamed'}. Status: ${result.status ?? 'unknown'}.` }],
706
- structuredContent: toStructuredContent(result),
707
- };
478
+ return { content: [], structuredContent: toStructuredContent(result) };
708
479
  } catch (err) {
709
480
  return apiErrorResult(err);
710
481
  }
@@ -719,7 +490,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
719
490
  inputSchema: {
720
491
  hubId: z.string().describe('Peer hub UUID to revoke'),
721
492
  },
722
- outputSchema: PeerActionOutputSchema,
723
493
  annotations: {
724
494
  readOnlyHint: false,
725
495
  destructiveHint: true,
@@ -731,10 +501,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
731
501
  async (args) => {
732
502
  try {
733
503
  const result = await client.federationAdmin.revokePeer(args.hubId);
734
- return {
735
- content: [{ type: 'text', text: `Peer hub ${args.hubId} revoked. It can no longer communicate with this federation hub.` }],
736
- structuredContent: toStructuredContent(result),
737
- };
504
+ return { content: [], structuredContent: toStructuredContent(result) };
738
505
  } catch (err) {
739
506
  return apiErrorResult(err);
740
507
  }
@@ -749,7 +516,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
749
516
  inputSchema: {
750
517
  hubId: z.string().describe('Peer hub UUID to resync'),
751
518
  },
752
- outputSchema: PeerActionOutputSchema,
753
519
  annotations: {
754
520
  readOnlyHint: false,
755
521
  destructiveHint: false,
@@ -761,10 +527,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
761
527
  async (args) => {
762
528
  try {
763
529
  const result = await client.federationAdmin.resyncPeer(args.hubId);
764
- return {
765
- content: [{ type: 'text', text: `Resync initiated for peer hub ${args.hubId}. Synced: ${result.synced}.` }],
766
- structuredContent: toStructuredContent(result),
767
- };
530
+ return { content: [], structuredContent: toStructuredContent(result) };
768
531
  } catch (err) {
769
532
  return apiErrorResult(err);
770
533
  }
@@ -777,7 +540,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
777
540
  title: 'Create Peering Token',
778
541
  description: 'Create a one-time peering token that another hub can use to register as a peer. Share this token securely with the remote hub administrator.',
779
542
  inputSchema: {},
780
- outputSchema: PeeringTokenOutputSchema,
781
543
  annotations: {
782
544
  readOnlyHint: false,
783
545
  destructiveHint: false,
@@ -789,10 +551,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
789
551
  async () => {
790
552
  try {
791
553
  const result = await client.federationAdmin.createPeeringToken();
792
- return {
793
- content: [{ type: 'text', text: `Peering token created. Expires: ${result.expiresAt ?? 'n/a'}. Share securely with the remote hub administrator.` }],
794
- structuredContent: toStructuredContent(result),
795
- };
554
+ return { content: [], structuredContent: toStructuredContent(result) };
796
555
  } catch (err) {
797
556
  return apiErrorResult(err);
798
557
  }
@@ -808,7 +567,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
808
567
  contractType: z.string().describe('Contract type identifier'),
809
568
  version: z.string().describe('Schema version to delete'),
810
569
  },
811
- outputSchema: SchemaVersionDeleteOutputSchema,
812
570
  annotations: {
813
571
  readOnlyHint: false,
814
572
  destructiveHint: true,
@@ -820,10 +578,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
820
578
  async (args) => {
821
579
  try {
822
580
  const result = await client.federationAdmin.deleteSchemaVersion(args.contractType, args.version);
823
- return {
824
- content: [{ type: 'text', text: `Schema version ${args.version} deleted for ${args.contractType}. Gateways using this version must upgrade.` }],
825
- structuredContent: toStructuredContent(result),
826
- };
581
+ return { content: [], structuredContent: toStructuredContent(result) };
827
582
  } catch (err) {
828
583
  return apiErrorResult(err);
829
584
  }
@@ -838,7 +593,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
838
593
  inputSchema: {
839
594
  agentId: z.string().describe('Federated agent ID'),
840
595
  },
841
- outputSchema: ReputationContributionListOutputSchema,
842
596
  annotations: {
843
597
  readOnlyHint: true,
844
598
  destructiveHint: false,
@@ -850,10 +604,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
850
604
  async (args) => {
851
605
  try {
852
606
  const result = await client.federationAdmin.listReputationContributions(args.agentId);
853
- return {
854
- content: [{ type: 'text', text: `Found ${result.length} reputation contribution(s) for agent ${args.agentId}.` }],
855
- structuredContent: toStructuredContent({ contributions: result }),
856
- };
607
+ return { content: [], structuredContent: toStructuredContent({ contributions: result }) };
857
608
  } catch (err) {
858
609
  return apiErrorResult(err);
859
610
  }
@@ -868,7 +619,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
868
619
  inputSchema: {
869
620
  agentId: z.string().describe('Federated agent ID whose reputation to reset'),
870
621
  },
871
- outputSchema: ReputationResetOutputSchema,
872
622
  annotations: {
873
623
  readOnlyHint: false,
874
624
  destructiveHint: true,
@@ -880,10 +630,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
880
630
  async (args) => {
881
631
  try {
882
632
  const result = await client.federationAdmin.resetReputation(args.agentId);
883
- return {
884
- content: [{ type: 'text', text: `Reputation reset for agent ${args.agentId}. All historical data cleared.` }],
885
- structuredContent: toStructuredContent(result),
886
- };
633
+ return { content: [], structuredContent: toStructuredContent(result) };
887
634
  } catch (err) {
888
635
  return apiErrorResult(err);
889
636
  }
@@ -898,7 +645,6 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
898
645
  inputSchema: {
899
646
  mandateId: z.string().describe('Federation mandate ID'),
900
647
  },
901
- outputSchema: MandateCriteriaStatusOutputSchema,
902
648
  annotations: {
903
649
  readOnlyHint: true,
904
650
  destructiveHint: false,
@@ -910,10 +656,7 @@ export function registerFederationAdminTools(mcp: McpServer, client: AgledgerCli
910
656
  async (args) => {
911
657
  try {
912
658
  const result = await client.federationAdmin.getMandateCriteriaStatus(args.mandateId);
913
- return {
914
- content: [{ type: 'text', text: `Criteria status for mandate ${result.mandateId}: principal submitted: ${result.principalSubmitted}, performer submitted: ${result.performerSubmitted}, agreement reached: ${result.agreementReached}.` }],
915
- structuredContent: toStructuredContent(result),
916
- };
659
+ return { content: [], structuredContent: toStructuredContent(result) };
917
660
  } catch (err) {
918
661
  return apiErrorResult(err);
919
662
  }