@agledger/mcp-server 1.2.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/LICENSE +34 -0
- package/README.md +81 -0
- package/dist/enums.d.ts +108 -0
- package/dist/enums.d.ts.map +1 -0
- package/dist/enums.js +42 -0
- package/dist/enums.js.map +1 -0
- package/dist/errors.d.ts +5 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +42 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +91 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/contract-types.d.ts +5 -0
- package/dist/resources/contract-types.d.ts.map +1 -0
- package/dist/resources/contract-types.js +107 -0
- package/dist/resources/contract-types.js.map +1 -0
- package/dist/server.d.ts +21 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +116 -0
- package/dist/server.js.map +1 -0
- package/dist/tool-scopes.d.ts +23 -0
- package/dist/tool-scopes.d.ts.map +1 -0
- package/dist/tool-scopes.js +173 -0
- package/dist/tool-scopes.js.map +1 -0
- package/dist/tools/a2a.d.ts +9 -0
- package/dist/tools/a2a.d.ts.map +1 -0
- package/dist/tools/a2a.js +492 -0
- package/dist/tools/a2a.js.map +1 -0
- package/dist/tools/agent-mandates.d.ts +5 -0
- package/dist/tools/agent-mandates.d.ts.map +1 -0
- package/dist/tools/agent-mandates.js +296 -0
- package/dist/tools/agent-mandates.js.map +1 -0
- package/dist/tools/agents-refs.d.ts +5 -0
- package/dist/tools/agents-refs.d.ts.map +1 -0
- package/dist/tools/agents-refs.js +255 -0
- package/dist/tools/agents-refs.js.map +1 -0
- package/dist/tools/capabilities.d.ts +5 -0
- package/dist/tools/capabilities.d.ts.map +1 -0
- package/dist/tools/capabilities.js +69 -0
- package/dist/tools/capabilities.js.map +1 -0
- package/dist/tools/code-mode.d.ts +5 -0
- package/dist/tools/code-mode.d.ts.map +1 -0
- package/dist/tools/code-mode.js +426 -0
- package/dist/tools/code-mode.js.map +1 -0
- package/dist/tools/compliance.d.ts +5 -0
- package/dist/tools/compliance.d.ts.map +1 -0
- package/dist/tools/compliance.js +73 -0
- package/dist/tools/compliance.js.map +1 -0
- package/dist/tools/dashboard.d.ts +5 -0
- package/dist/tools/dashboard.d.ts.map +1 -0
- package/dist/tools/dashboard.js +67 -0
- package/dist/tools/dashboard.js.map +1 -0
- package/dist/tools/disputes.d.ts +5 -0
- package/dist/tools/disputes.d.ts.map +1 -0
- package/dist/tools/disputes.js +140 -0
- package/dist/tools/disputes.js.map +1 -0
- package/dist/tools/enterprises.d.ts +5 -0
- package/dist/tools/enterprises.d.ts.map +1 -0
- package/dist/tools/enterprises.js +212 -0
- package/dist/tools/enterprises.js.map +1 -0
- package/dist/tools/events.d.ts +5 -0
- package/dist/tools/events.d.ts.map +1 -0
- package/dist/tools/events.js +48 -0
- package/dist/tools/events.js.map +1 -0
- package/dist/tools/federation-admin.d.ts +5 -0
- package/dist/tools/federation-admin.d.ts.map +1 -0
- package/dist/tools/federation-admin.js +824 -0
- package/dist/tools/federation-admin.js.map +1 -0
- package/dist/tools/federation.d.ts +5 -0
- package/dist/tools/federation.d.ts.map +1 -0
- package/dist/tools/federation.js +703 -0
- package/dist/tools/federation.js.map +1 -0
- package/dist/tools/health.d.ts +5 -0
- package/dist/tools/health.d.ts.map +1 -0
- package/dist/tools/health.js +39 -0
- package/dist/tools/health.js.map +1 -0
- package/dist/tools/mandates.d.ts +5 -0
- package/dist/tools/mandates.d.ts.map +1 -0
- package/dist/tools/mandates.js +350 -0
- package/dist/tools/mandates.js.map +1 -0
- package/dist/tools/openclaw.d.ts +9 -0
- package/dist/tools/openclaw.d.ts.map +1 -0
- package/dist/tools/openclaw.js +142 -0
- package/dist/tools/openclaw.js.map +1 -0
- package/dist/tools/receipts.d.ts +5 -0
- package/dist/tools/receipts.d.ts.map +1 -0
- package/dist/tools/receipts.js +166 -0
- package/dist/tools/receipts.js.map +1 -0
- package/dist/tools/reputation.d.ts +5 -0
- package/dist/tools/reputation.d.ts.map +1 -0
- package/dist/tools/reputation.js +72 -0
- package/dist/tools/reputation.js.map +1 -0
- package/dist/tools/schemas.d.ts +5 -0
- package/dist/tools/schemas.d.ts.map +1 -0
- package/dist/tools/schemas.js +595 -0
- package/dist/tools/schemas.js.map +1 -0
- package/dist/tools/verification.d.ts +5 -0
- package/dist/tools/verification.d.ts.map +1 -0
- package/dist/tools/verification.js +77 -0
- package/dist/tools/verification.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,703 @@
|
|
|
1
|
+
/** AGLedger™ — Federation gateway MCP tools. Patent Pending. Copyright 2026 AGLedger LLC. All rights reserved. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { apiErrorResult } from '../errors.js';
|
|
4
|
+
import { toolMeta } from '../tool-scopes.js';
|
|
5
|
+
import { FederationSignalEnum, FederationOutcomeEnum, RevocationReasonEnum } from '../enums.js';
|
|
6
|
+
const GatewayOutputSchema = z.object({
|
|
7
|
+
gatewayId: z.string().describe('Federation gateway ID'),
|
|
8
|
+
organizationId: z.string().describe('Organization ID'),
|
|
9
|
+
status: z.string().describe('Gateway status'),
|
|
10
|
+
}).passthrough().describe('Federation gateway registration result');
|
|
11
|
+
const HeartbeatOutputSchema = z.object({
|
|
12
|
+
gatewayId: z.string().describe('Federation gateway ID'),
|
|
13
|
+
token: z.string().optional().describe('Refreshed bearer token'),
|
|
14
|
+
expiresAt: z.string().optional().describe('ISO 8601 token expiry'),
|
|
15
|
+
}).passthrough().describe('Heartbeat response with refreshed token');
|
|
16
|
+
const AgentOutputSchema = z.object({
|
|
17
|
+
agentId: z.string().describe('Federated agent ID'),
|
|
18
|
+
gatewayId: z.string().optional().describe('Owning gateway ID'),
|
|
19
|
+
contractTypes: z.array(z.string()).describe('Supported contract types'),
|
|
20
|
+
displayName: z.string().optional().describe('Agent display name'),
|
|
21
|
+
}).passthrough().describe('Federated agent registration result');
|
|
22
|
+
const AgentListOutputSchema = z.object({
|
|
23
|
+
agents: z.array(AgentOutputSchema).describe('List of federated agents'),
|
|
24
|
+
cursor: z.string().optional().describe('Pagination cursor for next page'),
|
|
25
|
+
}).passthrough().describe('Paginated list of federated agents');
|
|
26
|
+
const TransitionOutputSchema = z.object({
|
|
27
|
+
mandateId: z.string().describe('Mandate ID'),
|
|
28
|
+
state: z.string().describe('New mandate state'),
|
|
29
|
+
seq: z.number().describe('Sequence number'),
|
|
30
|
+
}).passthrough().describe('State transition result');
|
|
31
|
+
const SignalOutputSchema = z.object({
|
|
32
|
+
mandateId: z.string().describe('Mandate ID'),
|
|
33
|
+
signal: z.string().describe('Settlement signal'),
|
|
34
|
+
signalSeq: z.number().describe('Signal sequence number'),
|
|
35
|
+
}).passthrough().describe('Settlement signal relay result');
|
|
36
|
+
const KeyRotationOutputSchema = z.object({
|
|
37
|
+
gatewayId: z.string().describe('Gateway ID'),
|
|
38
|
+
rotatedAt: z.string().optional().describe('ISO 8601 rotation timestamp'),
|
|
39
|
+
}).passthrough().describe('Key rotation result');
|
|
40
|
+
const RevocationOutputSchema = z.object({
|
|
41
|
+
gatewayId: z.string().describe('Revoked gateway ID'),
|
|
42
|
+
reason: z.string().describe('Revocation reason'),
|
|
43
|
+
revokedAt: z.string().optional().describe('ISO 8601 revocation timestamp'),
|
|
44
|
+
}).passthrough().describe('Gateway revocation result');
|
|
45
|
+
const CatchUpOutputSchema = z.object({
|
|
46
|
+
data: z.array(TransitionOutputSchema).describe('Missed audit entries'),
|
|
47
|
+
nextPosition: z.number().optional().describe('Position for next catch-up call'),
|
|
48
|
+
}).passthrough().describe('Partition recovery result with missed transitions');
|
|
49
|
+
const StreamOutputSchema = z.object({
|
|
50
|
+
events: z.array(z.object({
|
|
51
|
+
type: z.string().describe('Event type'),
|
|
52
|
+
timestamp: z.string().describe('ISO 8601 event timestamp'),
|
|
53
|
+
}).passthrough()).optional().describe('Federation events since the given timestamp'),
|
|
54
|
+
}).passthrough().describe('Federation event stream result');
|
|
55
|
+
const SchemaPublishOutputSchema = z.object({
|
|
56
|
+
contractType: z.string().describe('Contract type identifier'),
|
|
57
|
+
status: z.string().optional().describe('Publication status (pending, confirmed)'),
|
|
58
|
+
confirmationToken: z.string().optional().describe('Token required to confirm the publication'),
|
|
59
|
+
}).passthrough().describe('Schema publication initiation result');
|
|
60
|
+
const SchemaConfirmOutputSchema = z.object({
|
|
61
|
+
contractType: z.string().describe('Contract type identifier'),
|
|
62
|
+
confirmed: z.boolean().optional().describe('Whether the publication was confirmed'),
|
|
63
|
+
}).passthrough().describe('Schema publication confirmation result');
|
|
64
|
+
const ContractTypeListOutputSchema = z.object({
|
|
65
|
+
contractTypes: z.array(z.object({
|
|
66
|
+
contractType: z.string().describe('Contract type identifier'),
|
|
67
|
+
version: z.string().optional().describe('Schema version'),
|
|
68
|
+
status: z.string().optional().describe('Type status'),
|
|
69
|
+
}).passthrough()).optional().describe('Available contract types'),
|
|
70
|
+
}).passthrough().describe('List of federated contract types');
|
|
71
|
+
const ContractTypeOutputSchema = z.object({
|
|
72
|
+
contractType: z.string().describe('Contract type identifier'),
|
|
73
|
+
version: z.string().optional().describe('Schema version'),
|
|
74
|
+
status: z.string().optional().describe('Type status'),
|
|
75
|
+
schema: z.record(z.string(), z.unknown()).optional().describe('JSON Schema definition'),
|
|
76
|
+
}).passthrough().describe('Contract type details');
|
|
77
|
+
const MandateCriteriaOutputSchema = z.object({
|
|
78
|
+
mandateId: z.string().describe('Federation mandate ID'),
|
|
79
|
+
contractType: z.string().optional().describe('Contract type identifier'),
|
|
80
|
+
criteria: z.record(z.string(), z.unknown()).optional().describe('Acceptance criteria'),
|
|
81
|
+
}).passthrough().describe('Cross-boundary mandate criteria');
|
|
82
|
+
const MandateCriteriaSubmitOutputSchema = z.object({
|
|
83
|
+
mandateId: z.string().describe('Federation mandate ID'),
|
|
84
|
+
status: z.string().optional().describe('Submission status'),
|
|
85
|
+
}).passthrough().describe('Criteria submission result');
|
|
86
|
+
const ReputationContributeOutputSchema = z.object({
|
|
87
|
+
agentId: z.string().describe('Federated agent ID'),
|
|
88
|
+
recorded: z.boolean().optional().describe('Whether the contribution was recorded'),
|
|
89
|
+
}).passthrough().describe('Reputation contribution result');
|
|
90
|
+
const AgentReputationOutputSchema = z.object({
|
|
91
|
+
agentId: z.string().describe('Federated agent ID'),
|
|
92
|
+
score: z.number().optional().describe('Aggregate reputation score'),
|
|
93
|
+
totalMandates: z.number().optional().describe('Total mandates across all gateways'),
|
|
94
|
+
}).passthrough().describe('Federated agent reputation');
|
|
95
|
+
const BroadcastRevocationsOutputSchema = z.object({
|
|
96
|
+
gatewayId: z.string().describe('Revoked gateway ID'),
|
|
97
|
+
peersNotified: z.number().optional().describe('Number of peer gateways notified'),
|
|
98
|
+
}).passthrough().describe('Revocation broadcast result');
|
|
99
|
+
const SyncAgentDirectoryOutputSchema = z.object({
|
|
100
|
+
synced: z.number().optional().describe('Number of agents synced'),
|
|
101
|
+
}).passthrough().describe('Agent directory sync result');
|
|
102
|
+
export function registerFederationTools(mcp, client) {
|
|
103
|
+
// --- federation_register ---
|
|
104
|
+
mcp.registerTool('federation_register', {
|
|
105
|
+
title: 'Register Federation Gateway',
|
|
106
|
+
description: 'Register a new federation gateway. No auth required — uses registration token and cryptographic signature for initial bootstrap.',
|
|
107
|
+
inputSchema: {
|
|
108
|
+
registrationToken: z.string().describe('One-time registration token issued by AGLedger'),
|
|
109
|
+
organizationId: z.string().describe('Organization ID for this gateway'),
|
|
110
|
+
signingPublicKey: z.string().describe('Ed25519 signing public key (base64)'),
|
|
111
|
+
encryptionPublicKey: z.string().describe('X25519 encryption public key (base64)'),
|
|
112
|
+
endpointUrl: z.string().describe('Gateway callback endpoint URL'),
|
|
113
|
+
revocationSecret: z.string().describe('Secret for self-service revocation'),
|
|
114
|
+
timestamp: z.string().describe('ISO 8601 timestamp of this request'),
|
|
115
|
+
nonce: z.string().describe('Unique nonce to prevent replay'),
|
|
116
|
+
signature: z.string().describe('Ed25519 signature over the registration payload'),
|
|
117
|
+
displayName: z.string().optional().describe('Human-readable gateway name'),
|
|
118
|
+
capabilities: z.array(z.string()).optional().describe('Gateway capabilities (e.g. contract types supported)'),
|
|
119
|
+
},
|
|
120
|
+
outputSchema: GatewayOutputSchema,
|
|
121
|
+
annotations: {
|
|
122
|
+
readOnlyHint: false,
|
|
123
|
+
destructiveHint: false,
|
|
124
|
+
idempotentHint: false,
|
|
125
|
+
openWorldHint: true,
|
|
126
|
+
},
|
|
127
|
+
_meta: toolMeta('federation_register'),
|
|
128
|
+
}, async (args) => {
|
|
129
|
+
try {
|
|
130
|
+
const result = await client.federation.register(args);
|
|
131
|
+
return {
|
|
132
|
+
content: [{ type: 'text', text: `Gateway ${result.gatewayId} registered. Token expires at ${result.bearerTokenExpiresAt}. Use federation_heartbeat to refresh your token before it expires.` }],
|
|
133
|
+
structuredContent: result,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
catch (err) {
|
|
137
|
+
return apiErrorResult(err);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
// --- federation_heartbeat ---
|
|
141
|
+
mcp.registerTool('federation_heartbeat', {
|
|
142
|
+
title: 'Federation Heartbeat',
|
|
143
|
+
description: 'Send a heartbeat to refresh the gateway bearer token. Call periodically to maintain gateway registration.',
|
|
144
|
+
inputSchema: {
|
|
145
|
+
gatewayId: z.string().describe('Gateway ID to heartbeat'),
|
|
146
|
+
agentCount: z.number().describe('Current number of federated agents'),
|
|
147
|
+
mandateCount: z.number().describe('Current number of active mandates'),
|
|
148
|
+
timestamp: z.string().describe('ISO 8601 timestamp of this heartbeat'),
|
|
149
|
+
},
|
|
150
|
+
outputSchema: HeartbeatOutputSchema,
|
|
151
|
+
annotations: {
|
|
152
|
+
readOnlyHint: false,
|
|
153
|
+
destructiveHint: false,
|
|
154
|
+
idempotentHint: true,
|
|
155
|
+
openWorldHint: true,
|
|
156
|
+
},
|
|
157
|
+
_meta: toolMeta('federation_heartbeat'),
|
|
158
|
+
}, async (args) => {
|
|
159
|
+
try {
|
|
160
|
+
const result = await client.federation.heartbeat(args);
|
|
161
|
+
return {
|
|
162
|
+
content: [{ type: 'text', text: `Heartbeat accepted for gateway ${args.gatewayId}. Token expires at ${result.bearerTokenExpiresAt}. ${result.revocations.length > 0 ? `${result.revocations.length} revocation(s) received.` : ''}` }],
|
|
163
|
+
structuredContent: result,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
catch (err) {
|
|
167
|
+
return apiErrorResult(err);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
// --- federation_register_agent ---
|
|
171
|
+
mcp.registerTool('federation_register_agent', {
|
|
172
|
+
title: 'Register Federated Agent',
|
|
173
|
+
description: 'Register an agent through this federation gateway. The agent becomes discoverable by other gateways for cross-organization mandates.',
|
|
174
|
+
inputSchema: {
|
|
175
|
+
agentId: z.string().describe('Agent ID to register'),
|
|
176
|
+
contractTypes: z.array(z.string()).describe('Contract types this agent supports'),
|
|
177
|
+
displayName: z.string().optional().describe('Human-readable agent name'),
|
|
178
|
+
},
|
|
179
|
+
outputSchema: AgentOutputSchema,
|
|
180
|
+
annotations: {
|
|
181
|
+
readOnlyHint: false,
|
|
182
|
+
destructiveHint: false,
|
|
183
|
+
idempotentHint: true,
|
|
184
|
+
openWorldHint: false,
|
|
185
|
+
},
|
|
186
|
+
_meta: toolMeta('federation_register_agent'),
|
|
187
|
+
}, async (args) => {
|
|
188
|
+
try {
|
|
189
|
+
const result = await client.federation.registerAgent(args);
|
|
190
|
+
return {
|
|
191
|
+
content: [{ type: 'text', text: `Agent ${args.agentId} registered: ${result.registered}.` }],
|
|
192
|
+
structuredContent: result,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
catch (err) {
|
|
196
|
+
return apiErrorResult(err);
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
// --- federation_list_agents ---
|
|
200
|
+
mcp.registerTool('federation_list_agents', {
|
|
201
|
+
title: 'List Federated Agents',
|
|
202
|
+
description: 'List agents registered through federation gateways. Filter by contract type to find agents capable of specific work.',
|
|
203
|
+
inputSchema: {
|
|
204
|
+
contractType: z.string().optional().describe('Filter by supported contract type'),
|
|
205
|
+
limit: z.number().optional().describe('Maximum number of agents to return'),
|
|
206
|
+
cursor: z.string().optional().describe('Pagination cursor from previous response'),
|
|
207
|
+
},
|
|
208
|
+
outputSchema: AgentListOutputSchema,
|
|
209
|
+
annotations: {
|
|
210
|
+
readOnlyHint: true,
|
|
211
|
+
destructiveHint: false,
|
|
212
|
+
idempotentHint: true,
|
|
213
|
+
openWorldHint: false,
|
|
214
|
+
},
|
|
215
|
+
_meta: toolMeta('federation_list_agents'),
|
|
216
|
+
}, async (args) => {
|
|
217
|
+
try {
|
|
218
|
+
const result = await client.federation.listAgents(args);
|
|
219
|
+
return {
|
|
220
|
+
content: [{ type: 'text', text: `Found ${result.data.length} federated agent(s).${result.hasMore ? ' More results available — pass cursor to paginate.' : ''}` }],
|
|
221
|
+
structuredContent: result,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
catch (err) {
|
|
225
|
+
return apiErrorResult(err);
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
// --- federation_submit_transition ---
|
|
229
|
+
mcp.registerTool('federation_submit_transition', {
|
|
230
|
+
title: 'Submit State Transition',
|
|
231
|
+
description: 'Submit a mandate state transition through the federation gateway. Each transition is cryptographically signed and sequenced for tamper-evident ordering.',
|
|
232
|
+
inputSchema: {
|
|
233
|
+
mandateId: z.string().describe('Mandate ID'),
|
|
234
|
+
gatewayId: z.string().describe('Submitting gateway ID'),
|
|
235
|
+
state: z.string().describe('New mandate state'),
|
|
236
|
+
contractType: z.string().describe('Contract type identifier'),
|
|
237
|
+
criteriaHash: z.string().describe('SHA-256 hash of the mandate criteria'),
|
|
238
|
+
role: z.enum(['principal', 'performer']).describe('Role of the submitting gateway'),
|
|
239
|
+
seq: z.number().describe('Sequence number for ordering'),
|
|
240
|
+
idempotencyKey: z.string().describe('Idempotency key to prevent duplicates'),
|
|
241
|
+
timestamp: z.string().describe('ISO 8601 timestamp of this transition'),
|
|
242
|
+
nonce: z.string().describe('Unique nonce to prevent replay'),
|
|
243
|
+
signature: z.string().describe('Ed25519 signature over the transition payload'),
|
|
244
|
+
performerGatewayId: z.string().optional().describe('Performer gateway ID (if different from submitter)'),
|
|
245
|
+
},
|
|
246
|
+
outputSchema: TransitionOutputSchema,
|
|
247
|
+
annotations: {
|
|
248
|
+
readOnlyHint: false,
|
|
249
|
+
destructiveHint: false,
|
|
250
|
+
idempotentHint: true,
|
|
251
|
+
openWorldHint: false,
|
|
252
|
+
},
|
|
253
|
+
_meta: toolMeta('federation_submit_transition'),
|
|
254
|
+
}, async (args) => {
|
|
255
|
+
try {
|
|
256
|
+
const result = await client.federation.submitStateTransition(args);
|
|
257
|
+
return {
|
|
258
|
+
content: [{ type: 'text', text: `Transition accepted. Hub state: ${result.hubState}. Sub-status: ${result.subStatus}. Hub timestamp: ${result.hubTimestamp}.` }],
|
|
259
|
+
structuredContent: result,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
catch (err) {
|
|
263
|
+
return apiErrorResult(err);
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
// --- federation_relay_signal ---
|
|
267
|
+
mcp.registerTool('federation_relay_signal', {
|
|
268
|
+
title: 'Relay Settlement Signal',
|
|
269
|
+
description: 'Relay a settlement signal (SETTLE, HOLD, or RELEASE) for a cross-gateway mandate. Signals are sequenced and cryptographically signed.',
|
|
270
|
+
inputSchema: {
|
|
271
|
+
mandateId: z.string().describe('Mandate ID'),
|
|
272
|
+
signal: FederationSignalEnum.describe('Settlement signal type'),
|
|
273
|
+
outcomeHash: z.string().describe('SHA-256 hash of the outcome payload'),
|
|
274
|
+
signalSeq: z.number().describe('Signal sequence number for ordering'),
|
|
275
|
+
validUntil: z.string().describe('ISO 8601 expiry for this signal'),
|
|
276
|
+
performerGatewayId: z.string().describe('Performer gateway ID'),
|
|
277
|
+
timestamp: z.string().describe('ISO 8601 timestamp of this signal'),
|
|
278
|
+
nonce: z.string().describe('Unique nonce to prevent replay'),
|
|
279
|
+
performerSignature: z.string().describe('Ed25519 signature from the performer gateway'),
|
|
280
|
+
outcome: FederationOutcomeEnum.optional().describe('Verdict outcome if signal is SETTLE'),
|
|
281
|
+
},
|
|
282
|
+
outputSchema: SignalOutputSchema,
|
|
283
|
+
annotations: {
|
|
284
|
+
readOnlyHint: false,
|
|
285
|
+
destructiveHint: false,
|
|
286
|
+
idempotentHint: true,
|
|
287
|
+
openWorldHint: false,
|
|
288
|
+
},
|
|
289
|
+
_meta: toolMeta('federation_relay_signal'),
|
|
290
|
+
}, async (args) => {
|
|
291
|
+
try {
|
|
292
|
+
const result = await client.federation.relaySignal(args);
|
|
293
|
+
return {
|
|
294
|
+
content: [{ type: 'text', text: `Signal relayed: ${result.relayed}. Target gateway: ${result.targetGatewayId}. Hub timestamp: ${result.hubTimestamp}.` }],
|
|
295
|
+
structuredContent: result,
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
catch (err) {
|
|
299
|
+
return apiErrorResult(err);
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
// --- federation_rotate_key ---
|
|
303
|
+
mcp.registerTool('federation_rotate_key', {
|
|
304
|
+
title: 'Rotate Gateway Keys',
|
|
305
|
+
description: 'Rotate the signing and encryption keys for a federation gateway. Requires signatures from both the old and new keys to prove possession.',
|
|
306
|
+
inputSchema: {
|
|
307
|
+
gatewayId: z.string().describe('Gateway ID to rotate keys for'),
|
|
308
|
+
newSigningPublicKey: z.string().describe('New Ed25519 signing public key (base64)'),
|
|
309
|
+
newEncryptionPublicKey: z.string().describe('New X25519 encryption public key (base64)'),
|
|
310
|
+
signatureOldKey: z.string().describe('Signature from the current (old) signing key'),
|
|
311
|
+
signatureNewKey: z.string().describe('Signature from the new signing key'),
|
|
312
|
+
timestamp: z.string().describe('ISO 8601 timestamp of this rotation'),
|
|
313
|
+
nonce: z.string().describe('Unique nonce to prevent replay'),
|
|
314
|
+
},
|
|
315
|
+
outputSchema: KeyRotationOutputSchema,
|
|
316
|
+
annotations: {
|
|
317
|
+
readOnlyHint: false,
|
|
318
|
+
destructiveHint: true,
|
|
319
|
+
idempotentHint: false,
|
|
320
|
+
openWorldHint: false,
|
|
321
|
+
},
|
|
322
|
+
_meta: toolMeta('federation_rotate_key'),
|
|
323
|
+
}, async (args) => {
|
|
324
|
+
try {
|
|
325
|
+
const { gatewayId, ...rotateParams } = args;
|
|
326
|
+
const result = await client.federation.rotateKey(gatewayId, rotateParams);
|
|
327
|
+
return {
|
|
328
|
+
content: [{ type: 'text', text: `Keys rotated for gateway ${gatewayId}: ${result.rotated ? 'success' : 'failed'}.` }],
|
|
329
|
+
structuredContent: result,
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
catch (err) {
|
|
333
|
+
return apiErrorResult(err);
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
// --- federation_revoke ---
|
|
337
|
+
mcp.registerTool('federation_revoke', {
|
|
338
|
+
title: 'Revoke Federation Gateway',
|
|
339
|
+
description: 'Self-service gateway revocation. No auth required — uses the revocation secret set during registration. This permanently deactivates the gateway.',
|
|
340
|
+
inputSchema: {
|
|
341
|
+
gatewayId: z.string().describe('Gateway ID to revoke'),
|
|
342
|
+
revocationSecret: z.string().describe('Revocation secret set during registration'),
|
|
343
|
+
reason: RevocationReasonEnum.describe('Reason for revocation'),
|
|
344
|
+
},
|
|
345
|
+
outputSchema: RevocationOutputSchema,
|
|
346
|
+
annotations: {
|
|
347
|
+
readOnlyHint: false,
|
|
348
|
+
destructiveHint: true,
|
|
349
|
+
idempotentHint: false,
|
|
350
|
+
openWorldHint: false,
|
|
351
|
+
},
|
|
352
|
+
_meta: toolMeta('federation_revoke'),
|
|
353
|
+
}, async (args) => {
|
|
354
|
+
try {
|
|
355
|
+
const { gatewayId, ...revokeParams } = args;
|
|
356
|
+
const result = await client.federation.revoke(gatewayId, revokeParams);
|
|
357
|
+
return {
|
|
358
|
+
content: [{ type: 'text', text: `Gateway ${gatewayId} revoked: ${result.revoked}. Revoked at: ${result.revokedAt}. This action is permanent.` }],
|
|
359
|
+
structuredContent: result,
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
catch (err) {
|
|
363
|
+
return apiErrorResult(err);
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
// --- federation_catch_up ---
|
|
367
|
+
mcp.registerTool('federation_catch_up', {
|
|
368
|
+
title: 'Federation Catch-Up',
|
|
369
|
+
description: 'Recover missed state transitions after a network partition. Returns transitions since the given position for replay.',
|
|
370
|
+
inputSchema: {
|
|
371
|
+
sincePosition: z.number().describe('Position to catch up from (exclusive)'),
|
|
372
|
+
limit: z.number().optional().describe('Maximum number of transitions to return'),
|
|
373
|
+
},
|
|
374
|
+
outputSchema: CatchUpOutputSchema,
|
|
375
|
+
annotations: {
|
|
376
|
+
readOnlyHint: true,
|
|
377
|
+
destructiveHint: false,
|
|
378
|
+
idempotentHint: true,
|
|
379
|
+
openWorldHint: false,
|
|
380
|
+
},
|
|
381
|
+
_meta: toolMeta('federation_catch_up'),
|
|
382
|
+
}, async (args) => {
|
|
383
|
+
try {
|
|
384
|
+
const result = await client.federation.catchUp(args);
|
|
385
|
+
return {
|
|
386
|
+
content: [{ type: 'text', text: `Caught up ${result.data.length} entry(ies) since position ${args.sincePosition}.${result.hasMore ? ' More entries available.' : ' Fully caught up.'}` }],
|
|
387
|
+
structuredContent: result,
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
catch (err) {
|
|
391
|
+
return apiErrorResult(err);
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
// --- federation_stream ---
|
|
395
|
+
mcp.registerTool('federation_stream', {
|
|
396
|
+
title: 'Stream Federation Events',
|
|
397
|
+
description: 'Stream federation events since a given timestamp. Use this for real-time monitoring of cross-gateway activity. Omit "since" to get the latest events.',
|
|
398
|
+
inputSchema: {
|
|
399
|
+
since: z.string().optional().describe('ISO 8601 timestamp to stream events from (exclusive)'),
|
|
400
|
+
},
|
|
401
|
+
outputSchema: StreamOutputSchema,
|
|
402
|
+
annotations: {
|
|
403
|
+
readOnlyHint: true,
|
|
404
|
+
destructiveHint: false,
|
|
405
|
+
idempotentHint: true,
|
|
406
|
+
openWorldHint: true,
|
|
407
|
+
},
|
|
408
|
+
_meta: toolMeta('federation_stream'),
|
|
409
|
+
}, async (args) => {
|
|
410
|
+
try {
|
|
411
|
+
const result = await client.federation.stream({ since: args.since });
|
|
412
|
+
const events = Array.isArray(result['events']) ? result['events'] : [];
|
|
413
|
+
return {
|
|
414
|
+
content: [{ type: 'text', text: `Streamed ${events.length} federation event(s).${args.since ? ` Since: ${args.since}.` : ''}` }],
|
|
415
|
+
structuredContent: result,
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
catch (err) {
|
|
419
|
+
return apiErrorResult(err);
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
// --- federation_publish_schema ---
|
|
423
|
+
mcp.registerTool('federation_publish_schema', {
|
|
424
|
+
title: 'Publish Contract Type Schema',
|
|
425
|
+
description: 'Publish a contract type schema to the federation hub for cross-gateway use. Requires confirmation via federation_confirm_schema_publish before the schema becomes active. Set visibility to control distribution scope.',
|
|
426
|
+
inputSchema: {
|
|
427
|
+
contractType: z.string().describe('Contract type identifier (e.g. ACH-PROC-v1)'),
|
|
428
|
+
schema: z.record(z.string(), z.unknown()).describe('JSON Schema definition for the contract type'),
|
|
429
|
+
visibility: z.enum(['hub-only', 'full']).optional().describe('Distribution scope: hub-only (hub retains schema) or full (replicated to all gateways)'),
|
|
430
|
+
},
|
|
431
|
+
outputSchema: SchemaPublishOutputSchema,
|
|
432
|
+
annotations: {
|
|
433
|
+
readOnlyHint: false,
|
|
434
|
+
destructiveHint: false,
|
|
435
|
+
idempotentHint: false,
|
|
436
|
+
openWorldHint: true,
|
|
437
|
+
},
|
|
438
|
+
_meta: toolMeta('federation_publish_schema'),
|
|
439
|
+
}, async (args) => {
|
|
440
|
+
try {
|
|
441
|
+
const result = await client.federation.publishSchema(args.contractType, { schema: args.schema, visibility: args.visibility });
|
|
442
|
+
return {
|
|
443
|
+
content: [{ type: 'text', text: `Schema publication initiated for ${args.contractType}. Status: ${result.status ?? 'pending'}. Use federation_confirm_schema_publish with the confirmation token to finalize.` }],
|
|
444
|
+
structuredContent: result,
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
catch (err) {
|
|
448
|
+
return apiErrorResult(err);
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
// --- federation_confirm_schema_publish ---
|
|
452
|
+
mcp.registerTool('federation_confirm_schema_publish', {
|
|
453
|
+
title: 'Confirm Schema Publication',
|
|
454
|
+
description: 'Confirm a pending schema publication. After calling federation_publish_schema, use the returned confirmation token to finalize the publication.',
|
|
455
|
+
inputSchema: {
|
|
456
|
+
contractType: z.string().describe('Contract type identifier that was published'),
|
|
457
|
+
confirmationToken: z.string().describe('Confirmation token from the publish response'),
|
|
458
|
+
},
|
|
459
|
+
outputSchema: SchemaConfirmOutputSchema,
|
|
460
|
+
annotations: {
|
|
461
|
+
readOnlyHint: false,
|
|
462
|
+
destructiveHint: false,
|
|
463
|
+
idempotentHint: true,
|
|
464
|
+
openWorldHint: true,
|
|
465
|
+
},
|
|
466
|
+
_meta: toolMeta('federation_confirm_schema_publish'),
|
|
467
|
+
}, async (args) => {
|
|
468
|
+
try {
|
|
469
|
+
const result = await client.federation.confirmSchemaPublish(args.contractType, { confirmationToken: args.confirmationToken });
|
|
470
|
+
return {
|
|
471
|
+
content: [{ type: 'text', text: `Schema publication confirmed for ${args.contractType}. The schema is now available to federated gateways.` }],
|
|
472
|
+
structuredContent: result,
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
catch (err) {
|
|
476
|
+
return apiErrorResult(err);
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
// --- federation_list_contract_types ---
|
|
480
|
+
mcp.registerTool('federation_list_contract_types', {
|
|
481
|
+
title: 'List Federation Contract Types',
|
|
482
|
+
description: 'List contract types available through the federation hub. Use this to discover which contract types are supported across federated gateways before creating cross-boundary mandates.',
|
|
483
|
+
inputSchema: {},
|
|
484
|
+
outputSchema: ContractTypeListOutputSchema,
|
|
485
|
+
annotations: {
|
|
486
|
+
readOnlyHint: true,
|
|
487
|
+
destructiveHint: false,
|
|
488
|
+
idempotentHint: true,
|
|
489
|
+
openWorldHint: true,
|
|
490
|
+
},
|
|
491
|
+
_meta: toolMeta('federation_list_contract_types'),
|
|
492
|
+
}, async () => {
|
|
493
|
+
try {
|
|
494
|
+
const result = await client.federation.listContractTypes();
|
|
495
|
+
return {
|
|
496
|
+
content: [{ type: 'text', text: `Found ${result.length} federated contract type(s). Use federation_get_contract_type for details on a specific type.` }],
|
|
497
|
+
structuredContent: { contractTypes: result },
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
catch (err) {
|
|
501
|
+
return apiErrorResult(err);
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
// --- federation_get_contract_type ---
|
|
505
|
+
mcp.registerTool('federation_get_contract_type', {
|
|
506
|
+
title: 'Get Federation Contract Type',
|
|
507
|
+
description: 'Get details for a specific contract type in the federation, including its schema definition and which gateways support it.',
|
|
508
|
+
inputSchema: {
|
|
509
|
+
contractType: z.string().describe('Contract type identifier (e.g. ACH-PROC-v1)'),
|
|
510
|
+
},
|
|
511
|
+
outputSchema: ContractTypeOutputSchema,
|
|
512
|
+
annotations: {
|
|
513
|
+
readOnlyHint: true,
|
|
514
|
+
destructiveHint: false,
|
|
515
|
+
idempotentHint: true,
|
|
516
|
+
openWorldHint: true,
|
|
517
|
+
},
|
|
518
|
+
_meta: toolMeta('federation_get_contract_type'),
|
|
519
|
+
}, async (args) => {
|
|
520
|
+
try {
|
|
521
|
+
const result = await client.federation.getContractType(args.contractType);
|
|
522
|
+
return {
|
|
523
|
+
content: [{ type: 'text', text: `Contract type ${args.contractType}: ${result.status ?? 'unknown status'}. Schema version: ${result.version ?? 'n/a'}.` }],
|
|
524
|
+
structuredContent: result,
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
catch (err) {
|
|
528
|
+
return apiErrorResult(err);
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
// --- federation_get_mandate_criteria ---
|
|
532
|
+
mcp.registerTool('federation_get_mandate_criteria', {
|
|
533
|
+
title: 'Get Cross-Boundary Mandate Criteria',
|
|
534
|
+
description: 'Retrieve the acceptance criteria for a cross-boundary federation mandate. Use this when a performer gateway needs to understand what the principal requires before submitting a receipt.',
|
|
535
|
+
inputSchema: {
|
|
536
|
+
mandateId: z.string().describe('Federation mandate ID'),
|
|
537
|
+
},
|
|
538
|
+
outputSchema: MandateCriteriaOutputSchema,
|
|
539
|
+
annotations: {
|
|
540
|
+
readOnlyHint: true,
|
|
541
|
+
destructiveHint: false,
|
|
542
|
+
idempotentHint: true,
|
|
543
|
+
openWorldHint: false,
|
|
544
|
+
},
|
|
545
|
+
_meta: toolMeta('federation_get_mandate_criteria'),
|
|
546
|
+
}, async (args) => {
|
|
547
|
+
try {
|
|
548
|
+
const result = await client.federation.getMandateCriteria(args.mandateId);
|
|
549
|
+
return {
|
|
550
|
+
content: [{ type: 'text', text: `Criteria retrieved for mandate ${result.mandateId}. Submitted by: ${result.submittedBy}.` }],
|
|
551
|
+
structuredContent: result,
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
catch (err) {
|
|
555
|
+
return apiErrorResult(err);
|
|
556
|
+
}
|
|
557
|
+
});
|
|
558
|
+
// --- federation_submit_mandate_criteria ---
|
|
559
|
+
mcp.registerTool('federation_submit_mandate_criteria', {
|
|
560
|
+
title: 'Submit Cross-Boundary Mandate Criteria',
|
|
561
|
+
description: 'Submit acceptance criteria for a cross-boundary federation mandate. The principal gateway uses this to define what the performer must deliver. Use federation_get_mandate_criteria to verify the submission afterward.',
|
|
562
|
+
inputSchema: {
|
|
563
|
+
mandateId: z.string().describe('Federation mandate ID'),
|
|
564
|
+
criteria: z.record(z.string(), z.unknown()).describe('Acceptance criteria matching the contract type schema'),
|
|
565
|
+
},
|
|
566
|
+
outputSchema: MandateCriteriaSubmitOutputSchema,
|
|
567
|
+
annotations: {
|
|
568
|
+
readOnlyHint: false,
|
|
569
|
+
destructiveHint: false,
|
|
570
|
+
idempotentHint: true,
|
|
571
|
+
openWorldHint: false,
|
|
572
|
+
},
|
|
573
|
+
_meta: toolMeta('federation_submit_mandate_criteria'),
|
|
574
|
+
}, async (args) => {
|
|
575
|
+
try {
|
|
576
|
+
const result = await client.federation.submitMandateCriteria(args.mandateId, { criteria: args.criteria });
|
|
577
|
+
return {
|
|
578
|
+
content: [{ type: 'text', text: `Criteria submitted for mandate ${result.mandateId}. Submitted by: ${result.submittedBy} at ${result.submittedAt}.` }],
|
|
579
|
+
structuredContent: result,
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
catch (err) {
|
|
583
|
+
return apiErrorResult(err);
|
|
584
|
+
}
|
|
585
|
+
});
|
|
586
|
+
// --- federation_contribute_reputation ---
|
|
587
|
+
mcp.registerTool('federation_contribute_reputation', {
|
|
588
|
+
title: 'Contribute Reputation Data',
|
|
589
|
+
description: 'Contribute reputation data for a federated agent based on mandate outcomes. This feeds the cross-gateway Agent Health Score. Use after a mandate reaches a terminal state (FULFILLED or FAILED).',
|
|
590
|
+
inputSchema: {
|
|
591
|
+
agentId: z.string().describe('Federated agent ID'),
|
|
592
|
+
contractType: z.string().describe('Contract type of the completed mandate'),
|
|
593
|
+
outcome: z.string().describe('Mandate outcome (e.g. PASS, FAIL)'),
|
|
594
|
+
mandateId: z.string().optional().describe('Associated mandate ID for traceability'),
|
|
595
|
+
},
|
|
596
|
+
outputSchema: ReputationContributeOutputSchema,
|
|
597
|
+
annotations: {
|
|
598
|
+
readOnlyHint: false,
|
|
599
|
+
destructiveHint: false,
|
|
600
|
+
idempotentHint: true,
|
|
601
|
+
openWorldHint: false,
|
|
602
|
+
},
|
|
603
|
+
_meta: toolMeta('federation_contribute_reputation'),
|
|
604
|
+
}, async (args) => {
|
|
605
|
+
try {
|
|
606
|
+
const result = await client.federation.contributeReputation(args);
|
|
607
|
+
return {
|
|
608
|
+
content: [{ type: 'text', text: `Reputation contribution recorded for agent ${args.agentId}. Outcome: ${args.outcome}. Contract type: ${args.contractType}.` }],
|
|
609
|
+
structuredContent: result,
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
catch (err) {
|
|
613
|
+
return apiErrorResult(err);
|
|
614
|
+
}
|
|
615
|
+
});
|
|
616
|
+
// --- federation_get_agent_reputation ---
|
|
617
|
+
mcp.registerTool('federation_get_agent_reputation', {
|
|
618
|
+
title: 'Get Federated Agent Reputation',
|
|
619
|
+
description: 'Retrieve the federated reputation score for an agent across all gateways. This is the cross-gateway Agent Health Score — a "credit bureau" for agentic operations.',
|
|
620
|
+
inputSchema: {
|
|
621
|
+
agentId: z.string().describe('Federated agent ID'),
|
|
622
|
+
},
|
|
623
|
+
outputSchema: AgentReputationOutputSchema,
|
|
624
|
+
annotations: {
|
|
625
|
+
readOnlyHint: true,
|
|
626
|
+
destructiveHint: false,
|
|
627
|
+
idempotentHint: true,
|
|
628
|
+
openWorldHint: false,
|
|
629
|
+
},
|
|
630
|
+
_meta: toolMeta('federation_get_agent_reputation'),
|
|
631
|
+
}, async (args) => {
|
|
632
|
+
try {
|
|
633
|
+
const result = await client.federation.getAgentReputation(args.agentId);
|
|
634
|
+
return {
|
|
635
|
+
content: [{ type: 'text', text: `Reputation for agent ${args.agentId}: score ${result.overallScore}, contributions: ${result.contributions}.` }],
|
|
636
|
+
structuredContent: result,
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
catch (err) {
|
|
640
|
+
return apiErrorResult(err);
|
|
641
|
+
}
|
|
642
|
+
});
|
|
643
|
+
// --- federation_broadcast_revocations ---
|
|
644
|
+
mcp.registerTool('federation_broadcast_revocations', {
|
|
645
|
+
title: 'Broadcast Revocations to Peers',
|
|
646
|
+
description: 'Broadcast gateway revocation notices to all peer gateways. Use when a gateway has been compromised or decommissioned so peers can stop accepting its credentials.',
|
|
647
|
+
inputSchema: {
|
|
648
|
+
gatewayId: z.string().describe('Revoked gateway ID to broadcast'),
|
|
649
|
+
reason: z.string().describe('Reason for revocation'),
|
|
650
|
+
revokedAt: z.string().describe('ISO 8601 timestamp when the revocation occurred'),
|
|
651
|
+
},
|
|
652
|
+
outputSchema: BroadcastRevocationsOutputSchema,
|
|
653
|
+
annotations: {
|
|
654
|
+
readOnlyHint: false,
|
|
655
|
+
destructiveHint: false,
|
|
656
|
+
idempotentHint: true,
|
|
657
|
+
openWorldHint: true,
|
|
658
|
+
},
|
|
659
|
+
_meta: toolMeta('federation_broadcast_revocations'),
|
|
660
|
+
}, async (args) => {
|
|
661
|
+
try {
|
|
662
|
+
const result = await client.federation.broadcastRevocations(args);
|
|
663
|
+
return {
|
|
664
|
+
content: [{ type: 'text', text: `Revocation broadcast sent for gateway ${args.gatewayId}. Broadcast: ${result.broadcast}.` }],
|
|
665
|
+
structuredContent: result,
|
|
666
|
+
};
|
|
667
|
+
}
|
|
668
|
+
catch (err) {
|
|
669
|
+
return apiErrorResult(err);
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
// --- federation_sync_agent_directory ---
|
|
673
|
+
mcp.registerTool('federation_sync_agent_directory', {
|
|
674
|
+
title: 'Sync Agent Directory with Peer',
|
|
675
|
+
description: 'Synchronize the local agent directory with a peer gateway. Pushes the list of agents and their supported contract types so peers can discover available performers.',
|
|
676
|
+
inputSchema: {
|
|
677
|
+
agents: z.array(z.object({
|
|
678
|
+
agentId: z.string().describe('Agent ID'),
|
|
679
|
+
contractTypes: z.array(z.string()).describe('Contract types this agent supports'),
|
|
680
|
+
})).describe('List of agents to sync'),
|
|
681
|
+
},
|
|
682
|
+
outputSchema: SyncAgentDirectoryOutputSchema,
|
|
683
|
+
annotations: {
|
|
684
|
+
readOnlyHint: false,
|
|
685
|
+
destructiveHint: false,
|
|
686
|
+
idempotentHint: true,
|
|
687
|
+
openWorldHint: true,
|
|
688
|
+
},
|
|
689
|
+
_meta: toolMeta('federation_sync_agent_directory'),
|
|
690
|
+
}, async (args) => {
|
|
691
|
+
try {
|
|
692
|
+
const result = await client.federation.syncAgentDirectory(args);
|
|
693
|
+
return {
|
|
694
|
+
content: [{ type: 'text', text: `Agent directory synced: ${args.agents.length} agent(s) pushed. Synced: ${result.synced ?? 0}.` }],
|
|
695
|
+
structuredContent: result,
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
catch (err) {
|
|
699
|
+
return apiErrorResult(err);
|
|
700
|
+
}
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
//# sourceMappingURL=federation.js.map
|