@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.
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1 -3
- package/dist/server.js.map +1 -1
- package/dist/tool-scopes.d.ts.map +1 -1
- package/dist/tool-scopes.js +0 -3
- package/dist/tool-scopes.js.map +1 -1
- package/dist/tools/a2a.d.ts.map +1 -1
- package/dist/tools/a2a.js +20 -220
- package/dist/tools/a2a.js.map +1 -1
- package/dist/tools/agent-mandates.d.ts.map +1 -1
- package/dist/tools/agent-mandates.js +10 -74
- package/dist/tools/agent-mandates.js.map +1 -1
- package/dist/tools/agents-refs.d.ts.map +1 -1
- package/dist/tools/agents-refs.js +9 -61
- package/dist/tools/agents-refs.js.map +1 -1
- package/dist/tools/capabilities.d.ts.map +1 -1
- package/dist/tools/capabilities.js +2 -14
- package/dist/tools/capabilities.js.map +1 -1
- package/dist/tools/code-mode.d.ts.map +1 -1
- package/dist/tools/code-mode.js +4 -35
- package/dist/tools/code-mode.js.map +1 -1
- package/dist/tools/compliance.d.ts.map +1 -1
- package/dist/tools/compliance.js +3 -37
- package/dist/tools/compliance.js.map +1 -1
- package/dist/tools/dashboard.d.ts.map +1 -1
- package/dist/tools/dashboard.js +3 -37
- package/dist/tools/dashboard.js.map +1 -1
- package/dist/tools/disputes.d.ts.map +1 -1
- package/dist/tools/disputes.js +4 -41
- package/dist/tools/disputes.js.map +1 -1
- package/dist/tools/enterprises.d.ts.map +1 -1
- package/dist/tools/enterprises.js +6 -62
- package/dist/tools/enterprises.js.map +1 -1
- package/dist/tools/events.d.ts.map +1 -1
- package/dist/tools/events.js +1 -19
- package/dist/tools/events.js.map +1 -1
- package/dist/tools/federation-admin.d.ts.map +1 -1
- package/dist/tools/federation-admin.js +24 -256
- package/dist/tools/federation-admin.js.map +1 -1
- package/dist/tools/federation.d.ts.map +1 -1
- package/dist/tools/federation.js +20 -197
- package/dist/tools/federation.js.map +1 -1
- package/dist/tools/health.d.ts.map +1 -1
- package/dist/tools/health.js +1 -13
- package/dist/tools/health.js.map +1 -1
- package/dist/tools/mandates.d.ts.map +1 -1
- package/dist/tools/mandates.js +10 -93
- package/dist/tools/mandates.js.map +1 -1
- package/dist/tools/openclaw.d.ts.map +1 -1
- package/dist/tools/openclaw.js +5 -32
- package/dist/tools/openclaw.js.map +1 -1
- package/dist/tools/receipts.d.ts.map +1 -1
- package/dist/tools/receipts.js +4 -94
- package/dist/tools/receipts.js.map +1 -1
- package/dist/tools/reputation.d.ts.map +1 -1
- package/dist/tools/reputation.js +3 -33
- package/dist/tools/reputation.js.map +1 -1
- package/dist/tools/schemas.d.ts.map +1 -1
- package/dist/tools/schemas.js +16 -186
- package/dist/tools/schemas.js.map +1 -1
- package/dist/tools/verification-keys.d.ts.map +1 -1
- package/dist/tools/verification-keys.js +1 -22
- package/dist/tools/verification-keys.js.map +1 -1
- package/dist/tools/verification.d.ts.map +1 -1
- package/dist/tools/verification.js +2 -27
- package/dist/tools/verification.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -3
- package/src/server.ts +3 -5
- package/src/tool-scopes.ts +0 -4
- package/src/tools/a2a.ts +20 -233
- package/src/tools/agent-mandates.ts +10 -76
- package/src/tools/agents-refs.ts +9 -65
- package/src/tools/capabilities.ts +2 -15
- package/src/tools/compliance.ts +3 -37
- package/src/tools/dashboard.ts +3 -37
- package/src/tools/disputes.ts +4 -42
- package/src/tools/enterprises.ts +6 -62
- package/src/tools/events.ts +1 -20
- package/src/tools/federation-admin.ts +24 -281
- package/src/tools/federation.ts +20 -217
- package/src/tools/health.ts +1 -14
- package/src/tools/mandates.ts +10 -95
- package/src/tools/openclaw.ts +5 -51
- package/src/tools/receipts.ts +4 -95
- package/src/tools/reputation.ts +3 -34
- package/src/tools/schemas.ts +16 -194
- package/src/tools/verification-keys.ts +1 -24
- package/src/tools/verification.ts +2 -29
- package/tests/conformance.test.ts +4 -26
- package/tests/conformance.ts +3 -13
- package/tests/profiles.test.ts +2 -17
- package/tests/tools/a2a.test.ts +0 -28
- package/tests/tools/agent-mandates.test.ts +0 -10
- package/tests/tools/agents-refs.test.ts +0 -9
- package/tests/tools/capabilities.test.ts +0 -6
- package/tests/tools/compliance.test.ts +0 -8
- package/tests/tools/dashboard.test.ts +0 -9
- package/tests/tools/disputes.test.ts +0 -8
- package/tests/tools/enterprises.test.ts +0 -10
- package/tests/tools/events.test.ts +0 -5
- package/tests/tools/federation-admin.test.ts +0 -41
- package/tests/tools/federation.test.ts +0 -34
- package/tests/tools/health.test.ts +1 -12
- package/tests/tools/mandates.test.ts +0 -12
- package/tests/tools/openclaw.test.ts +0 -12
- package/tests/tools/receipts.test.ts +1 -14
- package/tests/tools/reputation.test.ts +0 -9
- package/tests/tools/schemas.test.ts +0 -23
- package/tests/tools/verification-keys.test.ts +0 -6
- package/tests/tools/verification.test.ts +1 -11
- package/src/tools/code-mode.ts +0 -461
- package/tests/drift/code-mode-manifest.test.ts +0 -144
- package/tests/integration/output-schema-validation.test.ts +0 -167
- package/tests/tools/code-mode.test.ts +0 -168
|
@@ -2,142 +2,6 @@ import { z } from 'zod';
|
|
|
2
2
|
import { apiErrorResult, toStructuredContent } from '../errors.js';
|
|
3
3
|
import { toolMeta } from '../tool-scopes.js';
|
|
4
4
|
import { HubStateEnum, GatewayStatusEnum } from '../enums.js';
|
|
5
|
-
const RegistrationTokenOutputSchema = z.object({
|
|
6
|
-
token: z.string().describe('Registration token string'),
|
|
7
|
-
label: z.string().optional().describe('Human-readable label for the token'),
|
|
8
|
-
expiresAt: z.string().optional().describe('ISO 8601 expiration timestamp'),
|
|
9
|
-
allowedContractTypes: z.array(z.string()).optional().describe('Contract types this token permits'),
|
|
10
|
-
createdAt: z.string().describe('ISO 8601 creation timestamp'),
|
|
11
|
-
}).passthrough().describe('Federation registration token');
|
|
12
|
-
const GatewayOutputSchema = z.object({
|
|
13
|
-
id: z.string().describe('Gateway UUID'),
|
|
14
|
-
name: z.string().optional().describe('Gateway display name'),
|
|
15
|
-
status: z.string().describe('Gateway status (active, suspended, revoked)'),
|
|
16
|
-
createdAt: z.string().describe('ISO 8601 creation timestamp'),
|
|
17
|
-
updatedAt: z.string().optional().describe('ISO 8601 last update timestamp'),
|
|
18
|
-
}).passthrough().describe('Federation gateway object');
|
|
19
|
-
const GatewayListOutputSchema = z.object({
|
|
20
|
-
gateways: z.array(GatewayOutputSchema).describe('List of federation gateways'),
|
|
21
|
-
total: z.number().optional().describe('Total number of gateways matching the query'),
|
|
22
|
-
}).passthrough().describe('Paginated list of federation gateways');
|
|
23
|
-
const FederationMandateOutputSchema = z.object({
|
|
24
|
-
id: z.string().describe('Federation mandate UUID'),
|
|
25
|
-
gatewayId: z.string().describe('Originating gateway UUID'),
|
|
26
|
-
hubState: z.string().describe('Hub-side mandate state'),
|
|
27
|
-
contractType: z.string().optional().describe('Contract type identifier'),
|
|
28
|
-
createdAt: z.string().describe('ISO 8601 creation timestamp'),
|
|
29
|
-
}).passthrough().describe('Federation mandate object');
|
|
30
|
-
const FederationMandateListOutputSchema = z.object({
|
|
31
|
-
mandates: z.array(FederationMandateOutputSchema).describe('List of federation mandates'),
|
|
32
|
-
total: z.number().optional().describe('Total number of mandates matching the query'),
|
|
33
|
-
}).passthrough().describe('Paginated list of federation mandates');
|
|
34
|
-
const AuditLogEntrySchema = z.object({
|
|
35
|
-
id: z.string().describe('Audit log entry UUID'),
|
|
36
|
-
gatewayId: z.string().optional().describe('Gateway UUID associated with the entry'),
|
|
37
|
-
entryType: z.string().describe('Type of audit log entry'),
|
|
38
|
-
mandateId: z.string().optional().describe('Associated mandate UUID'),
|
|
39
|
-
timestamp: z.string().describe('ISO 8601 timestamp of the entry'),
|
|
40
|
-
details: z.record(z.string(), z.unknown()).optional().describe('Entry-specific details'),
|
|
41
|
-
}).passthrough().describe('Federation audit log entry');
|
|
42
|
-
const AuditLogOutputSchema = z.object({
|
|
43
|
-
entries: z.array(AuditLogEntrySchema).describe('List of audit log entries'),
|
|
44
|
-
total: z.number().optional().describe('Total number of entries matching the query'),
|
|
45
|
-
}).passthrough().describe('Paginated federation audit log');
|
|
46
|
-
const FederationHealthOutputSchema = z.object({
|
|
47
|
-
status: z.string().describe('Overall federation health status'),
|
|
48
|
-
activeGateways: z.number().optional().describe('Number of active gateways'),
|
|
49
|
-
pendingMandates: z.number().optional().describe('Number of pending federation mandates'),
|
|
50
|
-
dlqDepth: z.number().optional().describe('Number of entries in the dead letter queue'),
|
|
51
|
-
timestamp: z.string().describe('ISO 8601 timestamp of the health check'),
|
|
52
|
-
}).passthrough().describe('Federation health summary');
|
|
53
|
-
const SequenceResetOutputSchema = z.object({
|
|
54
|
-
gatewayId: z.string().describe('Gateway UUID'),
|
|
55
|
-
previousSeq: z.number().optional().describe('Previous sequence number'),
|
|
56
|
-
newSeq: z.number().describe('New sequence number after reset'),
|
|
57
|
-
}).passthrough().describe('Sequence reset result');
|
|
58
|
-
const DlqEntrySchema = z.object({
|
|
59
|
-
id: z.string().describe('DLQ entry UUID'),
|
|
60
|
-
payload: z.record(z.string(), z.unknown()).optional().describe('Original message payload'),
|
|
61
|
-
error: z.string().optional().describe('Error that caused the entry to be dead-lettered'),
|
|
62
|
-
createdAt: z.string().describe('ISO 8601 timestamp when the entry was dead-lettered'),
|
|
63
|
-
retryCount: z.number().optional().describe('Number of retry attempts'),
|
|
64
|
-
}).passthrough().describe('Dead letter queue entry');
|
|
65
|
-
const DlqListOutputSchema = z.object({
|
|
66
|
-
entries: z.array(DlqEntrySchema).describe('List of DLQ entries'),
|
|
67
|
-
cursor: z.string().optional().describe('Cursor for the next page of results'),
|
|
68
|
-
}).passthrough().describe('Paginated dead letter queue entries');
|
|
69
|
-
const DlqRetryOutputSchema = z.object({
|
|
70
|
-
dlqId: z.string().describe('DLQ entry UUID that was retried'),
|
|
71
|
-
status: z.string().describe('Result of the retry attempt'),
|
|
72
|
-
}).passthrough().describe('DLQ retry result');
|
|
73
|
-
const DlqDeleteOutputSchema = z.object({
|
|
74
|
-
dlqId: z.string().describe('DLQ entry UUID that was deleted'),
|
|
75
|
-
deleted: z.boolean().describe('Whether the entry was successfully deleted'),
|
|
76
|
-
}).passthrough().describe('DLQ deletion result');
|
|
77
|
-
const RevokeOutputSchema = z.object({
|
|
78
|
-
gatewayId: z.string().describe('Revoked gateway UUID'),
|
|
79
|
-
status: z.string().describe('New gateway status after revocation'),
|
|
80
|
-
revokedAt: z.string().optional().describe('ISO 8601 revocation timestamp'),
|
|
81
|
-
}).passthrough().describe('Gateway revocation result');
|
|
82
|
-
const HubKeyOutputSchema = z.object({
|
|
83
|
-
keyId: z.string().optional().describe('New hub signing key UUID'),
|
|
84
|
-
publicKey: z.string().optional().describe('New Ed25519 public key (base64)'),
|
|
85
|
-
status: z.string().optional().describe('Key status (pending, active, expired)'),
|
|
86
|
-
createdAt: z.string().optional().describe('ISO 8601 creation timestamp'),
|
|
87
|
-
}).passthrough().describe('Hub signing key rotation result');
|
|
88
|
-
const HubKeyListOutputSchema = z.object({
|
|
89
|
-
keys: z.array(z.object({
|
|
90
|
-
keyId: z.string().describe('Hub key UUID'),
|
|
91
|
-
status: z.string().describe('Key status (pending, active, expired)'),
|
|
92
|
-
createdAt: z.string().describe('ISO 8601 creation timestamp'),
|
|
93
|
-
}).passthrough()).optional().describe('List of hub signing keys'),
|
|
94
|
-
}).passthrough().describe('Hub signing key list');
|
|
95
|
-
const HubKeyActionOutputSchema = z.object({
|
|
96
|
-
keyId: z.string().describe('Hub key UUID'),
|
|
97
|
-
status: z.string().optional().describe('New key status'),
|
|
98
|
-
}).passthrough().describe('Hub key action result');
|
|
99
|
-
const PeerOutputSchema = z.object({
|
|
100
|
-
hubId: z.string().optional().describe('Peer hub UUID'),
|
|
101
|
-
name: z.string().optional().describe('Peer hub name'),
|
|
102
|
-
endpoint: z.string().optional().describe('Peer hub API endpoint'),
|
|
103
|
-
status: z.string().optional().describe('Peer connection status'),
|
|
104
|
-
lastSyncAt: z.string().optional().describe('ISO 8601 last sync timestamp'),
|
|
105
|
-
}).passthrough().describe('Peer federation hub');
|
|
106
|
-
const PeerListOutputSchema = z.object({
|
|
107
|
-
peers: z.array(PeerOutputSchema).optional().describe('List of peer hubs'),
|
|
108
|
-
}).passthrough().describe('List of peer federation hubs');
|
|
109
|
-
const PeerActionOutputSchema = z.object({
|
|
110
|
-
hubId: z.string().describe('Peer hub UUID'),
|
|
111
|
-
status: z.string().optional().describe('Action result status'),
|
|
112
|
-
}).passthrough().describe('Peer hub action result');
|
|
113
|
-
const PeeringTokenOutputSchema = z.object({
|
|
114
|
-
token: z.string().optional().describe('One-time peering token'),
|
|
115
|
-
expiresAt: z.string().optional().describe('ISO 8601 token expiry'),
|
|
116
|
-
}).passthrough().describe('Peering token for cross-hub registration');
|
|
117
|
-
const SchemaVersionDeleteOutputSchema = z.object({
|
|
118
|
-
contractType: z.string().describe('Contract type identifier'),
|
|
119
|
-
version: z.string().describe('Deleted schema version'),
|
|
120
|
-
deleted: z.boolean().optional().describe('Whether the version was deleted'),
|
|
121
|
-
}).passthrough().describe('Schema version deletion result');
|
|
122
|
-
const ReputationContributionListOutputSchema = z.object({
|
|
123
|
-
contributions: z.array(z.object({
|
|
124
|
-
agentId: z.string().describe('Federated agent ID'),
|
|
125
|
-
contractType: z.string().describe('Contract type'),
|
|
126
|
-
outcome: z.string().describe('Mandate outcome'),
|
|
127
|
-
gatewayId: z.string().optional().describe('Contributing gateway ID'),
|
|
128
|
-
timestamp: z.string().optional().describe('ISO 8601 contribution timestamp'),
|
|
129
|
-
}).passthrough()).optional().describe('List of reputation contributions'),
|
|
130
|
-
}).passthrough().describe('Reputation contributions for an agent');
|
|
131
|
-
const ReputationResetOutputSchema = z.object({
|
|
132
|
-
agentId: z.string().describe('Federated agent ID'),
|
|
133
|
-
reset: z.boolean().optional().describe('Whether the reputation was reset'),
|
|
134
|
-
}).passthrough().describe('Reputation reset result');
|
|
135
|
-
const MandateCriteriaStatusOutputSchema = z.object({
|
|
136
|
-
mandateId: z.string().describe('Federation mandate ID'),
|
|
137
|
-
status: z.string().optional().describe('Criteria exchange status'),
|
|
138
|
-
principalSubmitted: z.boolean().optional().describe('Whether the principal has submitted criteria'),
|
|
139
|
-
performerAcknowledged: z.boolean().optional().describe('Whether the performer has acknowledged criteria'),
|
|
140
|
-
}).passthrough().describe('Cross-boundary criteria exchange status');
|
|
141
5
|
export function registerFederationAdminTools(mcp, client) {
|
|
142
6
|
mcp.registerTool('federation_create_token', {
|
|
143
7
|
title: 'Create Federation Registration Token',
|
|
@@ -147,7 +11,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
147
11
|
expiresInHours: z.number().optional().describe('Hours until the token expires'),
|
|
148
12
|
allowedContractTypes: z.array(z.string()).optional().describe('Contract types this token permits'),
|
|
149
13
|
},
|
|
150
|
-
outputSchema: RegistrationTokenOutputSchema,
|
|
151
14
|
annotations: {
|
|
152
15
|
readOnlyHint: false,
|
|
153
16
|
destructiveHint: false,
|
|
@@ -162,10 +25,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
162
25
|
expiresInHours: args.expiresInHours,
|
|
163
26
|
allowedContractTypes: args.allowedContractTypes,
|
|
164
27
|
});
|
|
165
|
-
return {
|
|
166
|
-
content: [{ type: 'text', text: `Registration token created. Expires: ${result.expiresAt}.` }],
|
|
167
|
-
structuredContent: toStructuredContent(result),
|
|
168
|
-
};
|
|
28
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
169
29
|
}
|
|
170
30
|
catch (err) {
|
|
171
31
|
return apiErrorResult(err);
|
|
@@ -179,7 +39,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
179
39
|
limit: z.number().optional().describe('Maximum number of results to return'),
|
|
180
40
|
offset: z.number().optional().describe('Number of results to skip for pagination'),
|
|
181
41
|
},
|
|
182
|
-
outputSchema: GatewayListOutputSchema,
|
|
183
42
|
annotations: {
|
|
184
43
|
readOnlyHint: true,
|
|
185
44
|
destructiveHint: false,
|
|
@@ -194,10 +53,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
194
53
|
limit: args.limit,
|
|
195
54
|
offset: args.offset,
|
|
196
55
|
});
|
|
197
|
-
return {
|
|
198
|
-
content: [{ type: 'text', text: `Found ${result.data.length} gateway(s).${result.total != null ? ` Total: ${result.total}.` : ''}` }],
|
|
199
|
-
structuredContent: toStructuredContent(result),
|
|
200
|
-
};
|
|
56
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
201
57
|
}
|
|
202
58
|
catch (err) {
|
|
203
59
|
return apiErrorResult(err);
|
|
@@ -210,7 +66,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
210
66
|
gatewayId: z.string().describe('UUID of the gateway to revoke'),
|
|
211
67
|
reason: z.string().describe('Reason for revocation (recorded in audit log)'),
|
|
212
68
|
},
|
|
213
|
-
outputSchema: RevokeOutputSchema,
|
|
214
69
|
annotations: {
|
|
215
70
|
readOnlyHint: false,
|
|
216
71
|
destructiveHint: true,
|
|
@@ -221,10 +76,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
221
76
|
}, async (args) => {
|
|
222
77
|
try {
|
|
223
78
|
const result = await client.federationAdmin.revokeGateway(args.gatewayId, { reason: args.reason });
|
|
224
|
-
return {
|
|
225
|
-
content: [{ type: 'text', text: `Gateway ${args.gatewayId} revoked. Reason: ${args.reason}.` }],
|
|
226
|
-
structuredContent: toStructuredContent(result),
|
|
227
|
-
};
|
|
79
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
228
80
|
}
|
|
229
81
|
catch (err) {
|
|
230
82
|
return apiErrorResult(err);
|
|
@@ -240,7 +92,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
240
92
|
limit: z.number().optional().describe('Maximum number of results to return'),
|
|
241
93
|
offset: z.number().optional().describe('Number of results to skip for pagination'),
|
|
242
94
|
},
|
|
243
|
-
outputSchema: FederationMandateListOutputSchema,
|
|
244
95
|
annotations: {
|
|
245
96
|
readOnlyHint: true,
|
|
246
97
|
destructiveHint: false,
|
|
@@ -257,10 +108,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
257
108
|
limit: args.limit,
|
|
258
109
|
offset: args.offset,
|
|
259
110
|
});
|
|
260
|
-
return {
|
|
261
|
-
content: [{ type: 'text', text: `Found ${result.data.length} federation mandate(s).${result.total != null ? ` Total: ${result.total}.` : ''}` }],
|
|
262
|
-
structuredContent: toStructuredContent(result),
|
|
263
|
-
};
|
|
111
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
264
112
|
}
|
|
265
113
|
catch (err) {
|
|
266
114
|
return apiErrorResult(err);
|
|
@@ -276,7 +124,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
276
124
|
limit: z.number().optional().describe('Maximum number of results to return'),
|
|
277
125
|
offset: z.number().optional().describe('Number of results to skip for pagination'),
|
|
278
126
|
},
|
|
279
|
-
outputSchema: AuditLogOutputSchema,
|
|
280
127
|
annotations: {
|
|
281
128
|
readOnlyHint: true,
|
|
282
129
|
destructiveHint: false,
|
|
@@ -293,10 +140,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
293
140
|
limit: args.limit,
|
|
294
141
|
offset: args.offset,
|
|
295
142
|
});
|
|
296
|
-
return {
|
|
297
|
-
content: [{ type: 'text', text: `Retrieved ${result.data.length} audit log entry(ies).${result.total != null ? ` Total: ${result.total}.` : ''}` }],
|
|
298
|
-
structuredContent: toStructuredContent(result),
|
|
299
|
-
};
|
|
143
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
300
144
|
}
|
|
301
145
|
catch (err) {
|
|
302
146
|
return apiErrorResult(err);
|
|
@@ -306,7 +150,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
306
150
|
title: 'Federation Health Summary',
|
|
307
151
|
description: 'Get the overall federation health summary, including active gateway count, pending mandates, and DLQ depth.',
|
|
308
152
|
inputSchema: {},
|
|
309
|
-
outputSchema: FederationHealthOutputSchema,
|
|
310
153
|
annotations: {
|
|
311
154
|
readOnlyHint: true,
|
|
312
155
|
destructiveHint: false,
|
|
@@ -317,10 +160,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
317
160
|
}, async () => {
|
|
318
161
|
try {
|
|
319
162
|
const result = await client.federationAdmin.getHealth();
|
|
320
|
-
return {
|
|
321
|
-
content: [{ type: 'text', text: `Federation health: ${result.gateways.active} active gateways, ${result.gateways.suspended} suspended, ${result.gateways.revoked} revoked. Audit chain length: ${result.auditChainLength}.` }],
|
|
322
|
-
structuredContent: toStructuredContent(result),
|
|
323
|
-
};
|
|
163
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
324
164
|
}
|
|
325
165
|
catch (err) {
|
|
326
166
|
return apiErrorResult(err);
|
|
@@ -333,7 +173,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
333
173
|
gatewayId: z.string().describe('UUID of the gateway whose sequence to reset'),
|
|
334
174
|
newSeq: z.number().optional().describe('New sequence number (defaults to server-determined value if omitted)'),
|
|
335
175
|
},
|
|
336
|
-
outputSchema: SequenceResetOutputSchema,
|
|
337
176
|
annotations: {
|
|
338
177
|
readOnlyHint: false,
|
|
339
178
|
destructiveHint: true,
|
|
@@ -344,10 +183,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
344
183
|
}, async (args) => {
|
|
345
184
|
try {
|
|
346
185
|
const result = await client.federationAdmin.resetSequence(args.gatewayId, { newSeq: args.newSeq });
|
|
347
|
-
return {
|
|
348
|
-
content: [{ type: 'text', text: `Sequence reset for gateway ${args.gatewayId}: ${result.reset ? 'success' : 'failed'}.` }],
|
|
349
|
-
structuredContent: toStructuredContent(result),
|
|
350
|
-
};
|
|
186
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
351
187
|
}
|
|
352
188
|
catch (err) {
|
|
353
189
|
return apiErrorResult(err);
|
|
@@ -360,7 +196,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
360
196
|
limit: z.number().optional().describe('Maximum number of results to return'),
|
|
361
197
|
cursor: z.string().optional().describe('Cursor for the next page of results'),
|
|
362
198
|
},
|
|
363
|
-
outputSchema: DlqListOutputSchema,
|
|
364
199
|
annotations: {
|
|
365
200
|
readOnlyHint: true,
|
|
366
201
|
destructiveHint: false,
|
|
@@ -374,10 +209,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
374
209
|
limit: args.limit,
|
|
375
210
|
cursor: args.cursor,
|
|
376
211
|
});
|
|
377
|
-
return {
|
|
378
|
-
content: [{ type: 'text', text: `Found ${result.data.length} DLQ entry(ies).${result.hasMore ? ' More available.' : ''}` }],
|
|
379
|
-
structuredContent: toStructuredContent(result),
|
|
380
|
-
};
|
|
212
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
381
213
|
}
|
|
382
214
|
catch (err) {
|
|
383
215
|
return apiErrorResult(err);
|
|
@@ -389,7 +221,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
389
221
|
inputSchema: {
|
|
390
222
|
dlqId: z.string().describe('UUID of the DLQ entry to retry'),
|
|
391
223
|
},
|
|
392
|
-
outputSchema: DlqRetryOutputSchema,
|
|
393
224
|
annotations: {
|
|
394
225
|
readOnlyHint: false,
|
|
395
226
|
destructiveHint: false,
|
|
@@ -400,10 +231,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
400
231
|
}, async (args) => {
|
|
401
232
|
try {
|
|
402
233
|
const result = await client.federationAdmin.retryDlq(args.dlqId);
|
|
403
|
-
return {
|
|
404
|
-
content: [{ type: 'text', text: `DLQ entry ${args.dlqId} retried: ${result.retried ? 'success' : 'failed'}.` }],
|
|
405
|
-
structuredContent: toStructuredContent(result),
|
|
406
|
-
};
|
|
234
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
407
235
|
}
|
|
408
236
|
catch (err) {
|
|
409
237
|
return apiErrorResult(err);
|
|
@@ -415,7 +243,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
415
243
|
inputSchema: {
|
|
416
244
|
dlqId: z.string().describe('UUID of the DLQ entry to delete'),
|
|
417
245
|
},
|
|
418
|
-
outputSchema: DlqDeleteOutputSchema,
|
|
419
246
|
annotations: {
|
|
420
247
|
readOnlyHint: false,
|
|
421
248
|
destructiveHint: true,
|
|
@@ -426,10 +253,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
426
253
|
}, async (args) => {
|
|
427
254
|
try {
|
|
428
255
|
const result = await client.federationAdmin.deleteDlq(args.dlqId);
|
|
429
|
-
return {
|
|
430
|
-
content: [{ type: 'text', text: `DLQ entry ${args.dlqId} deleted.` }],
|
|
431
|
-
structuredContent: toStructuredContent(result),
|
|
432
|
-
};
|
|
256
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
433
257
|
}
|
|
434
258
|
catch (err) {
|
|
435
259
|
return apiErrorResult(err);
|
|
@@ -439,7 +263,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
439
263
|
title: 'Rotate Hub Signing Key',
|
|
440
264
|
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.',
|
|
441
265
|
inputSchema: {},
|
|
442
|
-
outputSchema: HubKeyOutputSchema,
|
|
443
266
|
annotations: {
|
|
444
267
|
readOnlyHint: false,
|
|
445
268
|
destructiveHint: true,
|
|
@@ -450,10 +273,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
450
273
|
}, async () => {
|
|
451
274
|
try {
|
|
452
275
|
const result = await client.federationAdmin.rotateHubKey();
|
|
453
|
-
return {
|
|
454
|
-
content: [{ type: 'text', text: `Hub key rotated. New key ID: ${result.id}. Use federation_activate_hub_key to make it active.` }],
|
|
455
|
-
structuredContent: toStructuredContent(result),
|
|
456
|
-
};
|
|
276
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
457
277
|
}
|
|
458
278
|
catch (err) {
|
|
459
279
|
return apiErrorResult(err);
|
|
@@ -463,7 +283,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
463
283
|
title: 'List Hub Signing Keys',
|
|
464
284
|
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.',
|
|
465
285
|
inputSchema: {},
|
|
466
|
-
outputSchema: HubKeyListOutputSchema,
|
|
467
286
|
annotations: {
|
|
468
287
|
readOnlyHint: true,
|
|
469
288
|
destructiveHint: false,
|
|
@@ -474,10 +293,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
474
293
|
}, async () => {
|
|
475
294
|
try {
|
|
476
295
|
const result = await client.federationAdmin.listHubKeys();
|
|
477
|
-
return {
|
|
478
|
-
content: [{ type: 'text', text: `Found ${Array.isArray(result) ? result.length : 0} hub signing key(s).` }],
|
|
479
|
-
structuredContent: toStructuredContent({ keys: result }),
|
|
480
|
-
};
|
|
296
|
+
return { content: [], structuredContent: toStructuredContent({ keys: result }) };
|
|
481
297
|
}
|
|
482
298
|
catch (err) {
|
|
483
299
|
return apiErrorResult(err);
|
|
@@ -489,7 +305,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
489
305
|
inputSchema: {
|
|
490
306
|
keyId: z.string().describe('UUID of the hub key to activate'),
|
|
491
307
|
},
|
|
492
|
-
outputSchema: HubKeyActionOutputSchema,
|
|
493
308
|
annotations: {
|
|
494
309
|
readOnlyHint: false,
|
|
495
310
|
destructiveHint: false,
|
|
@@ -500,10 +315,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
500
315
|
}, async (args) => {
|
|
501
316
|
try {
|
|
502
317
|
const result = await client.federationAdmin.activateHubKey(args.keyId);
|
|
503
|
-
return {
|
|
504
|
-
content: [{ type: 'text', text: `Hub key ${args.keyId} activated. All gateways will now use this key for signature verification.` }],
|
|
505
|
-
structuredContent: toStructuredContent(result),
|
|
506
|
-
};
|
|
318
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
507
319
|
}
|
|
508
320
|
catch (err) {
|
|
509
321
|
return apiErrorResult(err);
|
|
@@ -515,7 +327,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
515
327
|
inputSchema: {
|
|
516
328
|
keyId: z.string().describe('UUID of the hub key to expire'),
|
|
517
329
|
},
|
|
518
|
-
outputSchema: HubKeyActionOutputSchema,
|
|
519
330
|
annotations: {
|
|
520
331
|
readOnlyHint: false,
|
|
521
332
|
destructiveHint: false,
|
|
@@ -526,10 +337,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
526
337
|
}, async (args) => {
|
|
527
338
|
try {
|
|
528
339
|
const result = await client.federationAdmin.expireHubKey(args.keyId);
|
|
529
|
-
return {
|
|
530
|
-
content: [{ type: 'text', text: `Hub key ${args.keyId} expired. It will no longer be accepted for signature verification.` }],
|
|
531
|
-
structuredContent: toStructuredContent(result),
|
|
532
|
-
};
|
|
340
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
533
341
|
}
|
|
534
342
|
catch (err) {
|
|
535
343
|
return apiErrorResult(err);
|
|
@@ -544,7 +352,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
544
352
|
publicKey: z.string().describe('Peer hub Ed25519 public key (base64)'),
|
|
545
353
|
peeringToken: z.string().describe('One-time peering token from the peer hub'),
|
|
546
354
|
},
|
|
547
|
-
outputSchema: PeerOutputSchema,
|
|
548
355
|
annotations: {
|
|
549
356
|
readOnlyHint: false,
|
|
550
357
|
destructiveHint: false,
|
|
@@ -555,10 +362,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
555
362
|
}, async (args) => {
|
|
556
363
|
try {
|
|
557
364
|
const result = await client.federationAdmin.registerPeer(args);
|
|
558
|
-
return {
|
|
559
|
-
content: [{ type: 'text', text: `Peer hub "${args.name}" registered. Hub ID: ${result.hubId ?? 'n/a'}. Use federation_resync_peer to synchronize state.` }],
|
|
560
|
-
structuredContent: toStructuredContent(result),
|
|
561
|
-
};
|
|
365
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
562
366
|
}
|
|
563
367
|
catch (err) {
|
|
564
368
|
return apiErrorResult(err);
|
|
@@ -568,7 +372,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
568
372
|
title: 'List Peer Hubs',
|
|
569
373
|
description: 'List all registered peer federation hubs. Shows connection status and last sync timestamp for each peer.',
|
|
570
374
|
inputSchema: {},
|
|
571
|
-
outputSchema: PeerListOutputSchema,
|
|
572
375
|
annotations: {
|
|
573
376
|
readOnlyHint: true,
|
|
574
377
|
destructiveHint: false,
|
|
@@ -579,10 +382,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
579
382
|
}, async () => {
|
|
580
383
|
try {
|
|
581
384
|
const result = await client.federationAdmin.listPeers();
|
|
582
|
-
return {
|
|
583
|
-
content: [{ type: 'text', text: `Found ${result.data.length} peer hub(s).` }],
|
|
584
|
-
structuredContent: toStructuredContent(result),
|
|
585
|
-
};
|
|
385
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
586
386
|
}
|
|
587
387
|
catch (err) {
|
|
588
388
|
return apiErrorResult(err);
|
|
@@ -594,7 +394,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
594
394
|
inputSchema: {
|
|
595
395
|
hubId: z.string().describe('Peer hub UUID'),
|
|
596
396
|
},
|
|
597
|
-
outputSchema: PeerOutputSchema,
|
|
598
397
|
annotations: {
|
|
599
398
|
readOnlyHint: true,
|
|
600
399
|
destructiveHint: false,
|
|
@@ -605,10 +404,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
605
404
|
}, async (args) => {
|
|
606
405
|
try {
|
|
607
406
|
const result = await client.federationAdmin.getPeer(args.hubId);
|
|
608
|
-
return {
|
|
609
|
-
content: [{ type: 'text', text: `Peer hub ${args.hubId}: ${result.name ?? 'unnamed'}. Status: ${result.status ?? 'unknown'}.` }],
|
|
610
|
-
structuredContent: toStructuredContent(result),
|
|
611
|
-
};
|
|
407
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
612
408
|
}
|
|
613
409
|
catch (err) {
|
|
614
410
|
return apiErrorResult(err);
|
|
@@ -620,7 +416,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
620
416
|
inputSchema: {
|
|
621
417
|
hubId: z.string().describe('Peer hub UUID to revoke'),
|
|
622
418
|
},
|
|
623
|
-
outputSchema: PeerActionOutputSchema,
|
|
624
419
|
annotations: {
|
|
625
420
|
readOnlyHint: false,
|
|
626
421
|
destructiveHint: true,
|
|
@@ -631,10 +426,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
631
426
|
}, async (args) => {
|
|
632
427
|
try {
|
|
633
428
|
const result = await client.federationAdmin.revokePeer(args.hubId);
|
|
634
|
-
return {
|
|
635
|
-
content: [{ type: 'text', text: `Peer hub ${args.hubId} revoked. It can no longer communicate with this federation hub.` }],
|
|
636
|
-
structuredContent: toStructuredContent(result),
|
|
637
|
-
};
|
|
429
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
638
430
|
}
|
|
639
431
|
catch (err) {
|
|
640
432
|
return apiErrorResult(err);
|
|
@@ -646,7 +438,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
646
438
|
inputSchema: {
|
|
647
439
|
hubId: z.string().describe('Peer hub UUID to resync'),
|
|
648
440
|
},
|
|
649
|
-
outputSchema: PeerActionOutputSchema,
|
|
650
441
|
annotations: {
|
|
651
442
|
readOnlyHint: false,
|
|
652
443
|
destructiveHint: false,
|
|
@@ -657,10 +448,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
657
448
|
}, async (args) => {
|
|
658
449
|
try {
|
|
659
450
|
const result = await client.federationAdmin.resyncPeer(args.hubId);
|
|
660
|
-
return {
|
|
661
|
-
content: [{ type: 'text', text: `Resync initiated for peer hub ${args.hubId}. Synced: ${result.synced}.` }],
|
|
662
|
-
structuredContent: toStructuredContent(result),
|
|
663
|
-
};
|
|
451
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
664
452
|
}
|
|
665
453
|
catch (err) {
|
|
666
454
|
return apiErrorResult(err);
|
|
@@ -670,7 +458,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
670
458
|
title: 'Create Peering Token',
|
|
671
459
|
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.',
|
|
672
460
|
inputSchema: {},
|
|
673
|
-
outputSchema: PeeringTokenOutputSchema,
|
|
674
461
|
annotations: {
|
|
675
462
|
readOnlyHint: false,
|
|
676
463
|
destructiveHint: false,
|
|
@@ -681,10 +468,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
681
468
|
}, async () => {
|
|
682
469
|
try {
|
|
683
470
|
const result = await client.federationAdmin.createPeeringToken();
|
|
684
|
-
return {
|
|
685
|
-
content: [{ type: 'text', text: `Peering token created. Expires: ${result.expiresAt ?? 'n/a'}. Share securely with the remote hub administrator.` }],
|
|
686
|
-
structuredContent: toStructuredContent(result),
|
|
687
|
-
};
|
|
471
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
688
472
|
}
|
|
689
473
|
catch (err) {
|
|
690
474
|
return apiErrorResult(err);
|
|
@@ -697,7 +481,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
697
481
|
contractType: z.string().describe('Contract type identifier'),
|
|
698
482
|
version: z.string().describe('Schema version to delete'),
|
|
699
483
|
},
|
|
700
|
-
outputSchema: SchemaVersionDeleteOutputSchema,
|
|
701
484
|
annotations: {
|
|
702
485
|
readOnlyHint: false,
|
|
703
486
|
destructiveHint: true,
|
|
@@ -708,10 +491,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
708
491
|
}, async (args) => {
|
|
709
492
|
try {
|
|
710
493
|
const result = await client.federationAdmin.deleteSchemaVersion(args.contractType, args.version);
|
|
711
|
-
return {
|
|
712
|
-
content: [{ type: 'text', text: `Schema version ${args.version} deleted for ${args.contractType}. Gateways using this version must upgrade.` }],
|
|
713
|
-
structuredContent: toStructuredContent(result),
|
|
714
|
-
};
|
|
494
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
715
495
|
}
|
|
716
496
|
catch (err) {
|
|
717
497
|
return apiErrorResult(err);
|
|
@@ -723,7 +503,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
723
503
|
inputSchema: {
|
|
724
504
|
agentId: z.string().describe('Federated agent ID'),
|
|
725
505
|
},
|
|
726
|
-
outputSchema: ReputationContributionListOutputSchema,
|
|
727
506
|
annotations: {
|
|
728
507
|
readOnlyHint: true,
|
|
729
508
|
destructiveHint: false,
|
|
@@ -734,10 +513,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
734
513
|
}, async (args) => {
|
|
735
514
|
try {
|
|
736
515
|
const result = await client.federationAdmin.listReputationContributions(args.agentId);
|
|
737
|
-
return {
|
|
738
|
-
content: [{ type: 'text', text: `Found ${result.length} reputation contribution(s) for agent ${args.agentId}.` }],
|
|
739
|
-
structuredContent: toStructuredContent({ contributions: result }),
|
|
740
|
-
};
|
|
516
|
+
return { content: [], structuredContent: toStructuredContent({ contributions: result }) };
|
|
741
517
|
}
|
|
742
518
|
catch (err) {
|
|
743
519
|
return apiErrorResult(err);
|
|
@@ -749,7 +525,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
749
525
|
inputSchema: {
|
|
750
526
|
agentId: z.string().describe('Federated agent ID whose reputation to reset'),
|
|
751
527
|
},
|
|
752
|
-
outputSchema: ReputationResetOutputSchema,
|
|
753
528
|
annotations: {
|
|
754
529
|
readOnlyHint: false,
|
|
755
530
|
destructiveHint: true,
|
|
@@ -760,10 +535,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
760
535
|
}, async (args) => {
|
|
761
536
|
try {
|
|
762
537
|
const result = await client.federationAdmin.resetReputation(args.agentId);
|
|
763
|
-
return {
|
|
764
|
-
content: [{ type: 'text', text: `Reputation reset for agent ${args.agentId}. All historical data cleared.` }],
|
|
765
|
-
structuredContent: toStructuredContent(result),
|
|
766
|
-
};
|
|
538
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
767
539
|
}
|
|
768
540
|
catch (err) {
|
|
769
541
|
return apiErrorResult(err);
|
|
@@ -775,7 +547,6 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
775
547
|
inputSchema: {
|
|
776
548
|
mandateId: z.string().describe('Federation mandate ID'),
|
|
777
549
|
},
|
|
778
|
-
outputSchema: MandateCriteriaStatusOutputSchema,
|
|
779
550
|
annotations: {
|
|
780
551
|
readOnlyHint: true,
|
|
781
552
|
destructiveHint: false,
|
|
@@ -786,10 +557,7 @@ export function registerFederationAdminTools(mcp, client) {
|
|
|
786
557
|
}, async (args) => {
|
|
787
558
|
try {
|
|
788
559
|
const result = await client.federationAdmin.getMandateCriteriaStatus(args.mandateId);
|
|
789
|
-
return {
|
|
790
|
-
content: [{ type: 'text', text: `Criteria status for mandate ${result.mandateId}: principal submitted: ${result.principalSubmitted}, performer submitted: ${result.performerSubmitted}, agreement reached: ${result.agreementReached}.` }],
|
|
791
|
-
structuredContent: toStructuredContent(result),
|
|
792
|
-
};
|
|
560
|
+
return { content: [], structuredContent: toStructuredContent(result) };
|
|
793
561
|
}
|
|
794
562
|
catch (err) {
|
|
795
563
|
return apiErrorResult(err);
|