@almanak/mcp-server 0.1.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/client.d.ts +97 -0
- package/dist/client.js +399 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +83 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +35 -0
- package/dist/server.js +149 -0
- package/dist/server.js.map +1 -0
- package/dist/tools.d.ts +31 -0
- package/dist/tools.js +500 -0
- package/dist/tools.js.map +1 -0
- package/package.json +26 -0
package/dist/tools.js
ADDED
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tool catalog and dispatch for the Almanak MCP server.
|
|
4
|
+
*
|
|
5
|
+
* Tools are organized into modes that can be selectively enabled:
|
|
6
|
+
* agents - Agent lifecycle (deploy, state, pause, stop, logs, pnl, etc.)
|
|
7
|
+
* wallets - Wallet listing, positions, role verification
|
|
8
|
+
* strategies - Strategy linking, validation, metadata
|
|
9
|
+
* github - Repository browsing (branches, tags, commits)
|
|
10
|
+
* edge - Edge signals and opportunities (planned)
|
|
11
|
+
* all - All available tools
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.PlatformToolHandler = void 0;
|
|
15
|
+
class PlatformToolHandler {
|
|
16
|
+
constructor(client, options) {
|
|
17
|
+
this.client = client;
|
|
18
|
+
this.tools = new Map();
|
|
19
|
+
this.options = { includeSecretTools: true, modes: ['all'], ...options };
|
|
20
|
+
this.enabledModes = new Set(this.options.modes);
|
|
21
|
+
this.registerAll();
|
|
22
|
+
}
|
|
23
|
+
listTools() {
|
|
24
|
+
return Array.from(this.tools.values()).map((t) => t.definition);
|
|
25
|
+
}
|
|
26
|
+
async callTool(name, args) {
|
|
27
|
+
var _a;
|
|
28
|
+
const entry = this.tools.get(name);
|
|
29
|
+
if (!entry) {
|
|
30
|
+
return {
|
|
31
|
+
content: [{ type: 'text', text: JSON.stringify({ error: `Unknown tool: ${name}` }) }],
|
|
32
|
+
isError: true,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const required = ((_a = entry.definition.inputSchema.required) !== null && _a !== void 0 ? _a : []);
|
|
36
|
+
const missing = required.filter((k) => args[k] === undefined || args[k] === null);
|
|
37
|
+
if (missing.length > 0) {
|
|
38
|
+
return {
|
|
39
|
+
content: [{ type: 'text', text: JSON.stringify({ error: `Missing required arguments: ${missing.join(', ')}` }) }],
|
|
40
|
+
isError: true,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
const result = await entry.handler(args);
|
|
45
|
+
const isError = (result === null || result === void 0 ? void 0 : result.statusCode) !== undefined && result.statusCode >= 400;
|
|
46
|
+
return {
|
|
47
|
+
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
|
|
48
|
+
isError,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
return {
|
|
53
|
+
content: [{ type: 'text', text: JSON.stringify({ error: err.message }) }],
|
|
54
|
+
isError: true,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
modeEnabled(mode) {
|
|
59
|
+
return this.enabledModes.has('all') || this.enabledModes.has(mode);
|
|
60
|
+
}
|
|
61
|
+
register(mode, definition, handler) {
|
|
62
|
+
if (!this.modeEnabled(mode))
|
|
63
|
+
return;
|
|
64
|
+
if (this.tools.has(definition.name)) {
|
|
65
|
+
throw new Error(`Duplicate tool registration: ${definition.name}`);
|
|
66
|
+
}
|
|
67
|
+
this.tools.set(definition.name, { definition, handler });
|
|
68
|
+
}
|
|
69
|
+
registerSecret(mode, definition, handler) {
|
|
70
|
+
if (!this.modeEnabled(mode))
|
|
71
|
+
return;
|
|
72
|
+
if (!this.options.includeSecretTools)
|
|
73
|
+
return;
|
|
74
|
+
if (this.tools.has(definition.name)) {
|
|
75
|
+
throw new Error(`Duplicate tool registration: ${definition.name}`);
|
|
76
|
+
}
|
|
77
|
+
this.tools.set(definition.name, { definition, handler });
|
|
78
|
+
}
|
|
79
|
+
registerAll() {
|
|
80
|
+
// ─── Agent tools ────────────────────────────────────────────
|
|
81
|
+
this.register('agents', {
|
|
82
|
+
name: 'agents_deploy',
|
|
83
|
+
description: 'Deploy a new V2 strategy agent. Creates the agent, triggers a container build from the GitHub strategy repository, and starts the deployment pipeline.',
|
|
84
|
+
inputSchema: {
|
|
85
|
+
type: 'object',
|
|
86
|
+
properties: {
|
|
87
|
+
agent_name: { type: 'string', description: 'Display name for the agent' },
|
|
88
|
+
github_strategy_link_id: { type: 'string', description: 'ID of the linked GitHub strategy' },
|
|
89
|
+
github_ref: { type: 'string', description: 'Git branch, tag, or commit SHA to deploy' },
|
|
90
|
+
github_ref_type: {
|
|
91
|
+
type: 'string',
|
|
92
|
+
enum: ['branch', 'tag', 'commit'],
|
|
93
|
+
description: 'Type of git reference',
|
|
94
|
+
},
|
|
95
|
+
wallet_id: { type: 'string', description: 'ID of the Safe wallet to use' },
|
|
96
|
+
config_overrides: {
|
|
97
|
+
type: 'object',
|
|
98
|
+
description: 'Optional strategy config overrides',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
required: ['agent_name', 'github_strategy_link_id', 'github_ref', 'github_ref_type', 'wallet_id'],
|
|
102
|
+
},
|
|
103
|
+
}, (args) => this.client.deployAgent({
|
|
104
|
+
agent_name: args.agent_name,
|
|
105
|
+
github_strategy_link_id: args.github_strategy_link_id,
|
|
106
|
+
github_ref: args.github_ref,
|
|
107
|
+
github_ref_type: args.github_ref_type,
|
|
108
|
+
wallet_id: args.wallet_id,
|
|
109
|
+
config_overrides: args.config_overrides,
|
|
110
|
+
}));
|
|
111
|
+
this.register('agents', {
|
|
112
|
+
name: 'agents_state',
|
|
113
|
+
description: 'Get the current state of a V2 agent including status, last heartbeat, error message, and iteration count.',
|
|
114
|
+
inputSchema: {
|
|
115
|
+
type: 'object',
|
|
116
|
+
properties: {
|
|
117
|
+
agent_id: { type: 'string', description: 'The agent ID' },
|
|
118
|
+
},
|
|
119
|
+
required: ['agent_id'],
|
|
120
|
+
},
|
|
121
|
+
}, (args) => this.client.getAgentState(args.agent_id));
|
|
122
|
+
this.register('agents', {
|
|
123
|
+
name: 'agents_pause',
|
|
124
|
+
description: 'Pause a running V2 agent. The agent will stop executing iterations but retain its state.',
|
|
125
|
+
inputSchema: {
|
|
126
|
+
type: 'object',
|
|
127
|
+
properties: { agent_id: { type: 'string', description: 'The agent ID' } },
|
|
128
|
+
required: ['agent_id'],
|
|
129
|
+
},
|
|
130
|
+
}, (args) => this.client.pauseAgent(args.agent_id));
|
|
131
|
+
this.register('agents', {
|
|
132
|
+
name: 'agents_resume',
|
|
133
|
+
description: 'Resume a paused V2 agent.',
|
|
134
|
+
inputSchema: {
|
|
135
|
+
type: 'object',
|
|
136
|
+
properties: { agent_id: { type: 'string', description: 'The agent ID' } },
|
|
137
|
+
required: ['agent_id'],
|
|
138
|
+
},
|
|
139
|
+
}, (args) => this.client.resumeAgent(args.agent_id));
|
|
140
|
+
this.register('agents', {
|
|
141
|
+
name: 'agents_stop',
|
|
142
|
+
description: 'Gracefully stop a running V2 agent. Tells the strategy to stop cleanly and begin teardown.',
|
|
143
|
+
inputSchema: {
|
|
144
|
+
type: 'object',
|
|
145
|
+
properties: { agent_id: { type: 'string', description: 'The agent ID' } },
|
|
146
|
+
required: ['agent_id'],
|
|
147
|
+
},
|
|
148
|
+
}, (args) => this.client.stopAgent(args.agent_id));
|
|
149
|
+
this.register('agents', {
|
|
150
|
+
name: 'agents_emergency_stop',
|
|
151
|
+
description: 'Emergency stop a V2 agent. Immediately kills the pod without graceful shutdown. Use only for urgent intervention.',
|
|
152
|
+
inputSchema: {
|
|
153
|
+
type: 'object',
|
|
154
|
+
properties: { agent_id: { type: 'string', description: 'The agent ID' } },
|
|
155
|
+
required: ['agent_id'],
|
|
156
|
+
},
|
|
157
|
+
}, (args) => this.client.emergencyStopAgent(args.agent_id));
|
|
158
|
+
this.register('agents', {
|
|
159
|
+
name: 'agents_terminate',
|
|
160
|
+
description: 'Terminate an inactive V2 agent from PAUSED or ERROR state.',
|
|
161
|
+
inputSchema: {
|
|
162
|
+
type: 'object',
|
|
163
|
+
properties: { agent_id: { type: 'string', description: 'The agent ID' } },
|
|
164
|
+
required: ['agent_id'],
|
|
165
|
+
},
|
|
166
|
+
}, (args) => this.client.terminateAgent(args.agent_id));
|
|
167
|
+
this.register('agents', {
|
|
168
|
+
name: 'agents_restart',
|
|
169
|
+
description: 'Restart a failed or terminated V2 agent. Reuses the cached strategy image and redeploys to the cluster.',
|
|
170
|
+
inputSchema: {
|
|
171
|
+
type: 'object',
|
|
172
|
+
properties: { agent_id: { type: 'string', description: 'The agent ID' } },
|
|
173
|
+
required: ['agent_id'],
|
|
174
|
+
},
|
|
175
|
+
}, (args) => this.client.restartAgent(args.agent_id));
|
|
176
|
+
this.register('agents', {
|
|
177
|
+
name: 'agents_redeploy',
|
|
178
|
+
description: 'Redeploy a closed or failed V2 agent. Fetches fresh code from GitHub, rebuilds the container image, and runs the full deployment pipeline again.',
|
|
179
|
+
inputSchema: {
|
|
180
|
+
type: 'object',
|
|
181
|
+
properties: { agent_id: { type: 'string', description: 'The agent ID' } },
|
|
182
|
+
required: ['agent_id'],
|
|
183
|
+
},
|
|
184
|
+
}, (args) => this.client.redeployAgent(args.agent_id));
|
|
185
|
+
this.register('agents', {
|
|
186
|
+
name: 'agents_close',
|
|
187
|
+
description: 'Close a V2 agent strategy. Releases the wallet and moves the agent to CLOSED state. Only available for TERMINATED or DEPLOY_FAILED agents.',
|
|
188
|
+
inputSchema: {
|
|
189
|
+
type: 'object',
|
|
190
|
+
properties: { agent_id: { type: 'string', description: 'The agent ID' } },
|
|
191
|
+
required: ['agent_id'],
|
|
192
|
+
},
|
|
193
|
+
}, (args) => this.client.closeAgent(args.agent_id));
|
|
194
|
+
this.registerSecret('agents', {
|
|
195
|
+
name: 'agents_logs',
|
|
196
|
+
description: 'Fetch container logs for a running or recently stopped agent. Returns paginated log entries from both gateway and strategy containers.',
|
|
197
|
+
inputSchema: {
|
|
198
|
+
type: 'object',
|
|
199
|
+
properties: {
|
|
200
|
+
agent_id: { type: 'string', description: 'The agent ID' },
|
|
201
|
+
navigation_mode: {
|
|
202
|
+
type: 'string',
|
|
203
|
+
enum: ['newest', 'oldest', 'around_timestamp'],
|
|
204
|
+
description: 'Log navigation mode (default: newest)',
|
|
205
|
+
},
|
|
206
|
+
page_size: { type: 'number', description: 'Number of log entries per page (default: 100)' },
|
|
207
|
+
target_timestamp: {
|
|
208
|
+
type: 'string',
|
|
209
|
+
description: 'ISO timestamp for around_timestamp navigation mode',
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
required: ['agent_id'],
|
|
213
|
+
},
|
|
214
|
+
}, (args) => {
|
|
215
|
+
var _a;
|
|
216
|
+
return this.client.getAgentLogs({
|
|
217
|
+
agentId: args.agent_id,
|
|
218
|
+
navigationMode: (_a = args.navigation_mode) !== null && _a !== void 0 ? _a : 'newest',
|
|
219
|
+
pageSize: args.page_size,
|
|
220
|
+
targetTimestamp: args.target_timestamp,
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
this.registerSecret('agents', {
|
|
224
|
+
name: 'agents_pnl',
|
|
225
|
+
description: 'Get profit and loss data for an agent including current value, returns, and APY.',
|
|
226
|
+
inputSchema: {
|
|
227
|
+
type: 'object',
|
|
228
|
+
properties: { agent_id: { type: 'string', description: 'The agent ID' } },
|
|
229
|
+
required: ['agent_id'],
|
|
230
|
+
},
|
|
231
|
+
}, (args) => this.client.getAgentPnl(args.agent_id));
|
|
232
|
+
this.registerSecret('agents', {
|
|
233
|
+
name: 'agents_transactions',
|
|
234
|
+
description: 'Get on-chain transaction history for an agent.',
|
|
235
|
+
inputSchema: {
|
|
236
|
+
type: 'object',
|
|
237
|
+
properties: {
|
|
238
|
+
agent_id: { type: 'string', description: 'The agent ID' },
|
|
239
|
+
page: { type: 'number', description: 'Page number (default: 1)' },
|
|
240
|
+
offset: { type: 'number', description: 'Items per page (default: 25)' },
|
|
241
|
+
sort: { type: 'string', enum: ['asc', 'desc'], description: 'Sort order (default: desc)' },
|
|
242
|
+
},
|
|
243
|
+
required: ['agent_id'],
|
|
244
|
+
},
|
|
245
|
+
}, (args) => this.client.getAgentTransactions({
|
|
246
|
+
agentId: args.agent_id,
|
|
247
|
+
page: args.page,
|
|
248
|
+
offset: args.offset,
|
|
249
|
+
sort: args.sort,
|
|
250
|
+
}));
|
|
251
|
+
this.register('agents', {
|
|
252
|
+
name: 'agents_sync_status',
|
|
253
|
+
description: 'Check if a deployed agent is in sync with its GitHub repository. Returns IN_SYNC, OUT_OF_SYNC, or UNKNOWN.',
|
|
254
|
+
inputSchema: {
|
|
255
|
+
type: 'object',
|
|
256
|
+
properties: {
|
|
257
|
+
agent_id: { type: 'string', description: 'The agent ID to check sync status for' },
|
|
258
|
+
},
|
|
259
|
+
required: ['agent_id'],
|
|
260
|
+
},
|
|
261
|
+
}, (args) => this.client.getAgentSyncStatus(args.agent_id));
|
|
262
|
+
// ─── Wallet tools ───────────────────────────────────────────
|
|
263
|
+
this.registerSecret('wallets', {
|
|
264
|
+
name: 'wallets_list',
|
|
265
|
+
description: 'List all Safe wallets with their balances, status, and chain information. Shows which wallets are available for deployment (not in use, status READY).',
|
|
266
|
+
inputSchema: {
|
|
267
|
+
type: 'object',
|
|
268
|
+
properties: {},
|
|
269
|
+
},
|
|
270
|
+
}, () => this.client.listWalletBalances());
|
|
271
|
+
this.registerSecret('wallets', {
|
|
272
|
+
name: 'wallets_positions',
|
|
273
|
+
description: 'Get DeFi positions for a specific wallet address including token balances and protocol positions.',
|
|
274
|
+
inputSchema: {
|
|
275
|
+
type: 'object',
|
|
276
|
+
properties: {
|
|
277
|
+
address: { type: 'string', description: 'Wallet address (0x...)' },
|
|
278
|
+
chain_id: { type: 'string', description: 'Chain ID (e.g. "42161" for Arbitrum)' },
|
|
279
|
+
},
|
|
280
|
+
required: ['address', 'chain_id'],
|
|
281
|
+
},
|
|
282
|
+
}, (args) => this.client.getWalletPositions(args.address, args.chain_id));
|
|
283
|
+
this.registerSecret('wallets', {
|
|
284
|
+
name: 'wallets_verify_role',
|
|
285
|
+
description: 'Verify that an EOA has the required Zodiac role on a Safe wallet. Used to check if permissions are correctly configured before deployment.',
|
|
286
|
+
inputSchema: {
|
|
287
|
+
type: 'object',
|
|
288
|
+
properties: {
|
|
289
|
+
smart_wallet_id: { type: 'string', description: 'The wallet ID' },
|
|
290
|
+
eoa_address: { type: 'string', description: 'EOA address to check (0x...)' },
|
|
291
|
+
role: { type: 'string', description: 'Role identifier to verify' },
|
|
292
|
+
},
|
|
293
|
+
required: ['smart_wallet_id', 'eoa_address', 'role'],
|
|
294
|
+
},
|
|
295
|
+
}, (args) => this.client.verifyEoaRole({
|
|
296
|
+
smart_wallet_id: args.smart_wallet_id,
|
|
297
|
+
eoa_address: args.eoa_address,
|
|
298
|
+
role: args.role,
|
|
299
|
+
}));
|
|
300
|
+
// ─── Strategy tools ─────────────────────────────────────────
|
|
301
|
+
this.register('strategies', {
|
|
302
|
+
name: 'strategies_list',
|
|
303
|
+
description: 'List all GitHub strategy repositories linked to the user account. Returns strategy name, repo info, and linked agents.',
|
|
304
|
+
inputSchema: {
|
|
305
|
+
type: 'object',
|
|
306
|
+
properties: {},
|
|
307
|
+
},
|
|
308
|
+
}, () => this.client.listStrategies());
|
|
309
|
+
this.register('strategies', {
|
|
310
|
+
name: 'strategies_link',
|
|
311
|
+
description: 'Link a GitHub repository as a strategy on the platform. Requires GitHub to be connected to the user account.',
|
|
312
|
+
inputSchema: {
|
|
313
|
+
type: 'object',
|
|
314
|
+
properties: {
|
|
315
|
+
display_name: { type: 'string', description: 'Display name for the strategy' },
|
|
316
|
+
repo_owner: { type: 'string', description: 'GitHub repository owner (user or org)' },
|
|
317
|
+
repo_name: { type: 'string', description: 'GitHub repository name' },
|
|
318
|
+
},
|
|
319
|
+
required: ['display_name', 'repo_owner', 'repo_name'],
|
|
320
|
+
},
|
|
321
|
+
}, (args) => this.client.linkStrategy({
|
|
322
|
+
displayName: args.display_name,
|
|
323
|
+
repoOwner: args.repo_owner,
|
|
324
|
+
repoName: args.repo_name,
|
|
325
|
+
}));
|
|
326
|
+
this.register('strategies', {
|
|
327
|
+
name: 'strategies_detail',
|
|
328
|
+
description: 'Get detailed information about a specific linked GitHub strategy.',
|
|
329
|
+
inputSchema: {
|
|
330
|
+
type: 'object',
|
|
331
|
+
properties: {
|
|
332
|
+
strategy_id: { type: 'string', description: 'The strategy link ID' },
|
|
333
|
+
},
|
|
334
|
+
required: ['strategy_id'],
|
|
335
|
+
},
|
|
336
|
+
}, (args) => this.client.getStrategy(args.strategy_id));
|
|
337
|
+
this.register('strategies', {
|
|
338
|
+
name: 'strategies_ref_metadata',
|
|
339
|
+
description: 'Get metadata for a strategy at a specific git ref. Returns chain, protocols, trade size, run interval, and permissions.',
|
|
340
|
+
inputSchema: {
|
|
341
|
+
type: 'object',
|
|
342
|
+
properties: {
|
|
343
|
+
strategy_id: { type: 'string', description: 'The strategy link ID' },
|
|
344
|
+
ref: { type: 'string', description: 'Git branch, tag, or commit SHA' },
|
|
345
|
+
},
|
|
346
|
+
required: ['strategy_id', 'ref'],
|
|
347
|
+
},
|
|
348
|
+
}, (args) => this.client.getStrategyRefMetadata(args.strategy_id, args.ref));
|
|
349
|
+
this.register('strategies', {
|
|
350
|
+
name: 'strategies_validate',
|
|
351
|
+
description: 'Validate a GitHub repository structure for deployment readiness. Performs a lightweight check for pyproject.toml with [tool.almanak], a run interval, and strategy.py entry point. Deeper dependency and config validation happens during the build stage.',
|
|
352
|
+
inputSchema: {
|
|
353
|
+
type: 'object',
|
|
354
|
+
properties: {
|
|
355
|
+
owner: { type: 'string', description: 'GitHub repository owner' },
|
|
356
|
+
repo: { type: 'string', description: 'GitHub repository name' },
|
|
357
|
+
ref: { type: 'string', description: 'Git ref to validate (optional)' },
|
|
358
|
+
},
|
|
359
|
+
required: ['owner', 'repo'],
|
|
360
|
+
},
|
|
361
|
+
}, (args) => this.client.validateRepository(args.owner, args.repo, args.ref));
|
|
362
|
+
// ─── GitHub repo browsing tools ─────────────────────────────
|
|
363
|
+
this.register('github', {
|
|
364
|
+
name: 'github_repositories',
|
|
365
|
+
description: 'List GitHub repositories accessible to the connected GitHub account. Use this to find repos that can be linked as strategies.',
|
|
366
|
+
inputSchema: {
|
|
367
|
+
type: 'object',
|
|
368
|
+
properties: {},
|
|
369
|
+
},
|
|
370
|
+
}, () => this.client.listRepositories());
|
|
371
|
+
this.register('github', {
|
|
372
|
+
name: 'github_branches',
|
|
373
|
+
description: 'List branches for a GitHub repository.',
|
|
374
|
+
inputSchema: {
|
|
375
|
+
type: 'object',
|
|
376
|
+
properties: {
|
|
377
|
+
owner: { type: 'string', description: 'GitHub repository owner' },
|
|
378
|
+
repo: { type: 'string', description: 'GitHub repository name' },
|
|
379
|
+
},
|
|
380
|
+
required: ['owner', 'repo'],
|
|
381
|
+
},
|
|
382
|
+
}, (args) => this.client.listBranches(args.owner, args.repo));
|
|
383
|
+
this.register('github', {
|
|
384
|
+
name: 'github_tags',
|
|
385
|
+
description: 'List tags for a GitHub repository.',
|
|
386
|
+
inputSchema: {
|
|
387
|
+
type: 'object',
|
|
388
|
+
properties: {
|
|
389
|
+
owner: { type: 'string', description: 'GitHub repository owner' },
|
|
390
|
+
repo: { type: 'string', description: 'GitHub repository name' },
|
|
391
|
+
},
|
|
392
|
+
required: ['owner', 'repo'],
|
|
393
|
+
},
|
|
394
|
+
}, (args) => this.client.listTags(args.owner, args.repo));
|
|
395
|
+
this.register('github', {
|
|
396
|
+
name: 'github_commits',
|
|
397
|
+
description: 'List recent commits for a GitHub repository.',
|
|
398
|
+
inputSchema: {
|
|
399
|
+
type: 'object',
|
|
400
|
+
properties: {
|
|
401
|
+
owner: { type: 'string', description: 'GitHub repository owner' },
|
|
402
|
+
repo: { type: 'string', description: 'GitHub repository name' },
|
|
403
|
+
sha: { type: 'string', description: 'Branch or commit SHA to list from (optional)' },
|
|
404
|
+
},
|
|
405
|
+
required: ['owner', 'repo'],
|
|
406
|
+
},
|
|
407
|
+
}, (args) => this.client.listCommits(args.owner, args.repo, args.sha));
|
|
408
|
+
// ─── Edge / Signal tools ──────────────────────────────────────
|
|
409
|
+
this.register('edge', {
|
|
410
|
+
name: 'signals_list',
|
|
411
|
+
description: 'List DeFi signals detected by Edge agents. Returns opportunities with alpha scores, confidence levels, risk scores, and strategy recommendations.',
|
|
412
|
+
inputSchema: {
|
|
413
|
+
type: 'object',
|
|
414
|
+
properties: {
|
|
415
|
+
type: { type: 'string', description: 'Filter by signal type (e.g. "YIELD", "WHALE", "GOVERNANCE", "TECHNICAL", "SMART_MONEY_MOVE", "LIQUIDATION_CLUSTER")' },
|
|
416
|
+
chain: { type: 'string', description: 'Filter by chain (e.g. "ethereum", "arbitrum", "base", "solana")' },
|
|
417
|
+
min_alpha_score: { type: 'number', description: 'Minimum alpha score (0-100)' },
|
|
418
|
+
search: { type: 'string', description: 'Search in signal title and summary' },
|
|
419
|
+
sort_by: { type: 'string', enum: ['alphaScore', 'createdAt', 'confidence', 'detectedAt'], description: 'Sort field (default: alphaScore)' },
|
|
420
|
+
limit: { type: 'number', description: 'Number of signals to return (default: 20)' },
|
|
421
|
+
offset: { type: 'number', description: 'Pagination offset (default: 0)' },
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
}, (args) => this.client.getSignals({
|
|
425
|
+
type: args.type,
|
|
426
|
+
chain: args.chain,
|
|
427
|
+
minAlphaScore: args.min_alpha_score,
|
|
428
|
+
search: args.search,
|
|
429
|
+
sortBy: args.sort_by,
|
|
430
|
+
limit: args.limit,
|
|
431
|
+
offset: args.offset,
|
|
432
|
+
}));
|
|
433
|
+
this.register('edge', {
|
|
434
|
+
name: 'signals_detail',
|
|
435
|
+
description: 'Get full details of a specific signal including complete analysis, strategy recommendation, risk breakdown, data sources, and market regime.',
|
|
436
|
+
inputSchema: {
|
|
437
|
+
type: 'object',
|
|
438
|
+
properties: {
|
|
439
|
+
signal_id: { type: 'string', description: 'The signal ID' },
|
|
440
|
+
},
|
|
441
|
+
required: ['signal_id'],
|
|
442
|
+
},
|
|
443
|
+
}, (args) => this.client.getSignalById(args.signal_id));
|
|
444
|
+
this.register('edge', {
|
|
445
|
+
name: 'signals_stats',
|
|
446
|
+
description: 'Get aggregate statistics about detected signals — total count and average alpha score.',
|
|
447
|
+
inputSchema: {
|
|
448
|
+
type: 'object',
|
|
449
|
+
properties: {},
|
|
450
|
+
},
|
|
451
|
+
}, () => this.client.getSignalStats());
|
|
452
|
+
this.register('edge', {
|
|
453
|
+
name: 'signals_outcome',
|
|
454
|
+
description: 'Get the outcome tracking data for a signal — was the prediction correct? Shows price at signal time, current/peak/trough prices, return percentage, and correctness status.',
|
|
455
|
+
inputSchema: {
|
|
456
|
+
type: 'object',
|
|
457
|
+
properties: {
|
|
458
|
+
signal_id: { type: 'string', description: 'The signal ID to check outcome for' },
|
|
459
|
+
},
|
|
460
|
+
required: ['signal_id'],
|
|
461
|
+
},
|
|
462
|
+
}, (args) => this.client.getSignalOutcome(args.signal_id));
|
|
463
|
+
this.register('edge', {
|
|
464
|
+
name: 'yields_list',
|
|
465
|
+
description: 'List DeFi yield opportunities across chains and protocols. Returns APY, TVL, risk scores, and deposit URLs.',
|
|
466
|
+
inputSchema: {
|
|
467
|
+
type: 'object',
|
|
468
|
+
properties: {
|
|
469
|
+
chain: { type: 'string', description: 'Filter by chain (e.g. "ethereum", "arbitrum", "base")' },
|
|
470
|
+
asset_group: { type: 'string', description: 'Filter by asset group (e.g. "stablecoin", "eth", "btc")' },
|
|
471
|
+
opportunity_type: { type: 'string', description: 'Filter by type (e.g. "lending", "lp", "staking")' },
|
|
472
|
+
min_apy: { type: 'number', description: 'Minimum APY percentage' },
|
|
473
|
+
search: { type: 'string', description: 'Search by name, protocol, or asset' },
|
|
474
|
+
sort_by: { type: 'string', enum: ['apy', 'tvl', 'risk', 'updated'], description: 'Sort field (default: apy)' },
|
|
475
|
+
limit: { type: 'number', description: 'Number of results (default: 20)' },
|
|
476
|
+
offset: { type: 'number', description: 'Pagination offset (default: 0)' },
|
|
477
|
+
},
|
|
478
|
+
},
|
|
479
|
+
}, (args) => this.client.getYields({
|
|
480
|
+
chain: args.chain,
|
|
481
|
+
assetGroup: args.asset_group,
|
|
482
|
+
opportunityType: args.opportunity_type,
|
|
483
|
+
minApy: args.min_apy,
|
|
484
|
+
search: args.search,
|
|
485
|
+
sortBy: args.sort_by,
|
|
486
|
+
limit: args.limit,
|
|
487
|
+
offset: args.offset,
|
|
488
|
+
}));
|
|
489
|
+
this.register('edge', {
|
|
490
|
+
name: 'yields_stats',
|
|
491
|
+
description: 'Get aggregate yield statistics — total number of opportunities and average APY across all tracked protocols.',
|
|
492
|
+
inputSchema: {
|
|
493
|
+
type: 'object',
|
|
494
|
+
properties: {},
|
|
495
|
+
},
|
|
496
|
+
}, () => this.client.getYieldStats());
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
exports.PlatformToolHandler = PlatformToolHandler;
|
|
500
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAmBH,MAAa,mBAAmB;IAK9B,YAAoB,MAAsB,EAAE,OAA4B;QAApD,WAAM,GAAN,MAAM,CAAgB;QAJlC,UAAK,GAA2B,IAAI,GAAG,EAAE,CAAC;QAKhD,IAAI,CAAC,OAAO,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC;QACxE,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAChD,IAAI,CAAC,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
4
|
+
"description": "MCP server exposing Almanak platform API as tools",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"almanak-platform-mcp": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"prepublishOnly": "npm run build",
|
|
17
|
+
"dev": "ts-node src/index.ts",
|
|
18
|
+
"typecheck": "tsc --noEmit"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/node": "^20.3.1",
|
|
23
|
+
"ts-node": "^10.9.1",
|
|
24
|
+
"typescript": "^5.1.3"
|
|
25
|
+
}
|
|
26
|
+
}
|