@continuumdao/ctm-mpc-defi 0.2.6 → 0.2.8
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/agent/catalog.cjs +124 -105
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +38 -5
- package/dist/agent/catalog.js +121 -105
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/_shared/multisign-mcp-gas.md +20 -0
- package/dist/agent/skills/aave-v4/SKILL.md +0 -7
- package/dist/agent/skills/curve-dao/SKILL.md +0 -7
- package/dist/agent/skills/ethena/SKILL.md +1 -1
- package/dist/agent/skills/euler-v2/SKILL.md +1 -1
- package/dist/agent/skills/gmx/SKILL.md +29 -2
- package/dist/agent/skills/lido/SKILL.md +1 -1
- package/dist/agent/skills/maple-syrup/SKILL.md +1 -1
- package/dist/agent/skills/sky/SKILL.md +1 -1
- package/dist/agent/skills/uniswap-v4/SKILL.md +0 -7
- package/dist/protocols/evm/gmx/index.cjs +2 -2
- package/dist/protocols/evm/gmx/index.cjs.map +1 -1
- package/dist/protocols/evm/gmx/index.js +2 -2
- package/dist/protocols/evm/gmx/index.js.map +1 -1
- package/package.json +1 -1
package/dist/agent/catalog.cjs
CHANGED
|
@@ -382,7 +382,7 @@ var EVM_COMMON_PARAM_DOCS = {
|
|
|
382
382
|
useCustomGas: {
|
|
383
383
|
type: "boolean",
|
|
384
384
|
required: true,
|
|
385
|
-
description: "When true, apply
|
|
385
|
+
description: "When true, apply Custom Gas Config from chainDetail / customGasChainDetails. Omitted baseFee/priorityFee is valid \u2014 live RPC fees are used at proposal; configured values are optional floors/multipliers. When false, use live RPC estimates only."
|
|
386
386
|
},
|
|
387
387
|
chainId: {
|
|
388
388
|
type: "number",
|
|
@@ -410,8 +410,17 @@ var EVM_COMMON_PARAM_DOCS = {
|
|
|
410
410
|
description: "Snapshot written to extraJSON.customGasChainDetails when useCustomGas is true."
|
|
411
411
|
}
|
|
412
412
|
};
|
|
413
|
+
var MULTISIGN_SUBMIT_OUTPUT_DOC = {
|
|
414
|
+
description: "Submitted mpc-auth multiSignRequest id. continuum-mcp-server builds, signs the management envelope, and POSTs /multiSignRequest. Continue with wait_for_sign_request_ready \u2192 sign_request_agree \u2192 trigger_sign_result \u2192 broadcast_sign_result. Do not call the same build tool again if requestId was returned.",
|
|
415
|
+
fields: {
|
|
416
|
+
requestId: {
|
|
417
|
+
type: "string",
|
|
418
|
+
description: "Sign request id from POST /multiSignRequest."
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
};
|
|
413
422
|
var MULTISIGN_OUTPUT_DOC = {
|
|
414
|
-
description: "Unsigned mpc-auth multiSignRequest payload.
|
|
423
|
+
description: "Unsigned mpc-auth multiSignRequest payload from protocol builders. MCP agents receive { requestId } instead; node-app callers sign messageToSign and POST { ...bodyForSign, clientSig, signedMessage }.",
|
|
415
424
|
fields: {
|
|
416
425
|
bodyForSign: {
|
|
417
426
|
type: "object",
|
|
@@ -460,6 +469,21 @@ var MANAGEMENT_SIG_DOC = {
|
|
|
460
469
|
fetchPreferredKeyGen: "GET /getPreferredKeyGen for agent default KeyGen."
|
|
461
470
|
}
|
|
462
471
|
};
|
|
472
|
+
|
|
473
|
+
// src/agent/mcpMultisignSubmitMeta.ts
|
|
474
|
+
var MCP_MULTISIGN_SUBMIT_DESCRIPTION_SUFFIX = "Builds the unsigned batch, signs the management envelope, and POSTs /multiSignRequest. Returns { requestId } on success \u2014 do not call again; use list_sign_requests to verify duplicates.";
|
|
475
|
+
var MCP_MULTISIGN_SUBMIT_FOLLOW_UP = [
|
|
476
|
+
"wait_for_sign_request_ready",
|
|
477
|
+
"sign_request_agree",
|
|
478
|
+
"trigger_sign_result",
|
|
479
|
+
"broadcast_sign_result"
|
|
480
|
+
];
|
|
481
|
+
function withMultisignSubmitMcpMeta(description, followUp = MCP_MULTISIGN_SUBMIT_FOLLOW_UP) {
|
|
482
|
+
return {
|
|
483
|
+
description: `${description.trim()} ${MCP_MULTISIGN_SUBMIT_DESCRIPTION_SUFFIX}`,
|
|
484
|
+
followUp: [...followUp]
|
|
485
|
+
};
|
|
486
|
+
}
|
|
463
487
|
function zodSchemaToMcpJsonSchema(schema) {
|
|
464
488
|
const raw = zodToJsonSchema.zodToJsonSchema(schema, {
|
|
465
489
|
target: "openApi3",
|
|
@@ -504,7 +528,7 @@ var evmMultisignCommonInputSchema = zod.z.object({
|
|
|
504
528
|
"Human-readable purpose for the sign request. Stored in bodyForSign.purpose (may be appended with an automatic batch suffix)."
|
|
505
529
|
),
|
|
506
530
|
useCustomGas: zod.z.boolean().describe(
|
|
507
|
-
"When true, apply
|
|
531
|
+
"When true, apply Custom Gas Config from chainDetail / customGasChainDetails. Omitted baseFee/priorityFee is valid \u2014 builder uses live RPC fees; configured values are optional floors/multipliers. When false, use live RPC estimates only."
|
|
508
532
|
),
|
|
509
533
|
chainId: zod.z.number().int().positive().describe("EVM chain id (decimal). Becomes destinationChainID on the sign request."),
|
|
510
534
|
rpcUrl: zod.z.string().min(1).describe("HTTPS JSON-RPC URL for gas estimation, nonce, and allowance reads."),
|
|
@@ -520,9 +544,12 @@ var multisignOutputSchema = zod.z.object({
|
|
|
520
544
|
),
|
|
521
545
|
messageToSign: zod.z.string().describe("JSON.stringify(bodyForSign) \u2014 exact string to sign before adding clientSig.")
|
|
522
546
|
}).describe(
|
|
523
|
-
"Unsigned mpc-auth multiSignRequest payload
|
|
547
|
+
"Unsigned mpc-auth multiSignRequest payload from protocol builders (used internally before management submit)."
|
|
524
548
|
);
|
|
525
549
|
var jsonObjectSchema = zod.z.record(zod.z.unknown());
|
|
550
|
+
function parseMultisignBuilderOutput(data) {
|
|
551
|
+
return multisignOutputSchema.parse(data);
|
|
552
|
+
}
|
|
526
553
|
var uniswapQuoteTradeTypeSchema = zod.z.enum(["EXACT_INPUT", "EXACT_OUTPUT"]);
|
|
527
554
|
var mcpUniswapV4QuoteInputSchema = zod.z.object({
|
|
528
555
|
type: uniswapQuoteTradeTypeSchema.describe("EXACT_INPUT or EXACT_OUTPUT"),
|
|
@@ -741,6 +768,26 @@ var mcpCurveDaoBuildSwapMultisignInputSchema = evmMultisignCommonInputSchema.ext
|
|
|
741
768
|
amountHuman: zod.z.string().min(1).describe("Human-readable amount of tokenIn"),
|
|
742
769
|
slippagePercent: zod.z.number().gt(0).lt(100).describe("Slippage 0\u2013100 exclusive")
|
|
743
770
|
});
|
|
771
|
+
var mcpServerCommonInputSchema = zod.z.object({
|
|
772
|
+
keyGenId: zod.z.string().min(1).describe("KeyGen id from fetch_key_gen_result / node preferred KeyGen"),
|
|
773
|
+
chainId: zod.z.number().int().positive().describe("EVM chain id; RPC and gas config resolved from chain registry"),
|
|
774
|
+
purposeText: zod.z.string().min(1).describe("Human-readable purpose for the sign request"),
|
|
775
|
+
useCustomGas: zod.z.boolean().optional().describe("Apply chain gas settings from registry when true")
|
|
776
|
+
});
|
|
777
|
+
function mcpServerMultisignInput(fields) {
|
|
778
|
+
return mcpServerCommonInputSchema.extend(fields);
|
|
779
|
+
}
|
|
780
|
+
var mcpServerSubmitOutputSchema = zod.z.object({
|
|
781
|
+
requestId: zod.z.string().min(1).describe("Sign request id from POST /multiSignRequest \u2014 success; do not retry the same build tool.")
|
|
782
|
+
}).describe(
|
|
783
|
+
"Submitted mpc-auth multiSignRequest. Continue with wait_for_sign_request_ready \u2192 sign_request_agree \u2192 trigger_sign_result \u2192 broadcast_sign_result."
|
|
784
|
+
);
|
|
785
|
+
var MCP_NON_SUBMIT_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
786
|
+
"ctm_uniswap_v4_quote",
|
|
787
|
+
"ctm_uniswap_v4_create_swap"
|
|
788
|
+
]);
|
|
789
|
+
|
|
790
|
+
// src/agent/schemas/protocols.ts
|
|
744
791
|
function mcpMultisignInput(fields) {
|
|
745
792
|
return evmMultisignCommonInputSchema.extend(fields);
|
|
746
793
|
}
|
|
@@ -1031,13 +1078,16 @@ var mcpGmxFetchOhlcvOutputSchema = zod.z.object({
|
|
|
1031
1078
|
|
|
1032
1079
|
// src/agent/mcpProtocolTools.ts
|
|
1033
1080
|
function defineProtocolMcpTool(def) {
|
|
1081
|
+
const meta = withMultisignSubmitMcpMeta(def.description, def.followUp ?? MCP_MULTISIGN_SUBMIT_FOLLOW_UP);
|
|
1034
1082
|
return {
|
|
1035
1083
|
...def,
|
|
1036
|
-
|
|
1084
|
+
description: meta.description,
|
|
1085
|
+
followUp: meta.followUp,
|
|
1086
|
+
outputZod: mcpServerSubmitOutputSchema,
|
|
1037
1087
|
inputSchema: zodSchemaToMcpJsonSchema(def.inputZod),
|
|
1038
|
-
outputSchema: zodSchemaToMcpJsonSchema(
|
|
1088
|
+
outputSchema: zodSchemaToMcpJsonSchema(mcpServerSubmitOutputSchema),
|
|
1039
1089
|
parseInput: (data) => def.inputZod.parse(data),
|
|
1040
|
-
parseOutput: (data) =>
|
|
1090
|
+
parseOutput: (data) => mcpServerSubmitOutputSchema.parse(data)
|
|
1041
1091
|
};
|
|
1042
1092
|
}
|
|
1043
1093
|
var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
@@ -1046,9 +1096,8 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1046
1096
|
actionId: "lido.submit",
|
|
1047
1097
|
protocolId: "lido",
|
|
1048
1098
|
chainCategory: "evm",
|
|
1049
|
-
description: "
|
|
1099
|
+
description: "Create and submit mpc-auth multiSignRequest for Lido ETH stake (submit).",
|
|
1050
1100
|
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
1051
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1052
1101
|
handler: { importPath: "protocols/evm/lido", exportName: "buildEvmMultisignBodyLidoSubmit" },
|
|
1053
1102
|
inputZod: mcpLidoSubmitInputSchema
|
|
1054
1103
|
}),
|
|
@@ -1059,7 +1108,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1059
1108
|
chainCategory: "evm",
|
|
1060
1109
|
description: "Build batch for Lido withdrawal queue (approve + requestWithdrawals).",
|
|
1061
1110
|
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
1062
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1063
1111
|
handler: { importPath: "protocols/evm/lido", exportName: "buildEvmMultisignBodyLidoRequestWithdrawals" },
|
|
1064
1112
|
inputZod: mcpLidoRequestWithdrawalsInputSchema
|
|
1065
1113
|
}),
|
|
@@ -1070,7 +1118,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1070
1118
|
chainCategory: "evm",
|
|
1071
1119
|
description: "Build tx for Lido claimWithdrawal.",
|
|
1072
1120
|
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
1073
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1074
1121
|
handler: { importPath: "protocols/evm/lido", exportName: "buildEvmMultisignBodyLidoClaimWithdrawal" },
|
|
1075
1122
|
inputZod: mcpLidoClaimWithdrawalInputSchema
|
|
1076
1123
|
}),
|
|
@@ -1081,7 +1128,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1081
1128
|
chainCategory: "evm",
|
|
1082
1129
|
description: "Build batch for wstETH wrap.",
|
|
1083
1130
|
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
1084
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1085
1131
|
handler: { importPath: "protocols/evm/lido", exportName: "buildEvmMultisignBodyLidoWrapStEth" },
|
|
1086
1132
|
inputZod: mcpLidoWrapStEthInputSchema
|
|
1087
1133
|
}),
|
|
@@ -1092,7 +1138,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1092
1138
|
chainCategory: "evm",
|
|
1093
1139
|
description: "Build tx for wstETH unwrap.",
|
|
1094
1140
|
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
1095
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1096
1141
|
handler: { importPath: "protocols/evm/lido", exportName: "buildEvmMultisignBodyLidoUnwrapWstEth" },
|
|
1097
1142
|
inputZod: mcpLidoUnwrapWstEthInputSchema
|
|
1098
1143
|
}),
|
|
@@ -1103,7 +1148,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1103
1148
|
chainCategory: "evm",
|
|
1104
1149
|
description: "Build batch: USDe approve + sUSDe deposit.",
|
|
1105
1150
|
prerequisites: ["keyGen", "executorAddress", "Ethereum mainnet RPC"],
|
|
1106
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1107
1151
|
handler: { importPath: "protocols/evm/ethena", exportName: "buildEvmMultisignBodyEthenaUsdeStakeToSusde" },
|
|
1108
1152
|
inputZod: mcpEthenaStakeInputSchema
|
|
1109
1153
|
}),
|
|
@@ -1114,7 +1158,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1114
1158
|
chainCategory: "evm",
|
|
1115
1159
|
description: "Build sUSDe redeem when cooldown is off.",
|
|
1116
1160
|
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
1117
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1118
1161
|
handler: { importPath: "protocols/evm/ethena", exportName: "buildEvmMultisignBodyEthenaSusdeRedeemToUsde" },
|
|
1119
1162
|
inputZod: mcpEthenaRedeemInputSchema
|
|
1120
1163
|
}),
|
|
@@ -1125,7 +1168,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1125
1168
|
chainCategory: "evm",
|
|
1126
1169
|
description: "Build sUSDe cooldownShares batch step.",
|
|
1127
1170
|
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
1128
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1129
1171
|
handler: { importPath: "protocols/evm/ethena", exportName: "buildEvmMultisignBodyEthenaSusdeCooldownShares" },
|
|
1130
1172
|
inputZod: mcpEthenaCooldownInputSchema
|
|
1131
1173
|
}),
|
|
@@ -1136,7 +1178,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1136
1178
|
chainCategory: "evm",
|
|
1137
1179
|
description: "Build unstake claim after cooldown.",
|
|
1138
1180
|
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
1139
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1140
1181
|
handler: { importPath: "protocols/evm/ethena", exportName: "buildEvmMultisignBodyEthenaUnstakeClaim" },
|
|
1141
1182
|
inputZod: mcpEthenaClaimInputSchema
|
|
1142
1183
|
}),
|
|
@@ -1147,7 +1188,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1147
1188
|
chainCategory: "evm",
|
|
1148
1189
|
description: "Build Maple Syrup router deposit batch.",
|
|
1149
1190
|
prerequisites: ["keyGen", "executorAddress", "router + pool addresses"],
|
|
1150
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1151
1191
|
handler: { importPath: "protocols/evm/maple", exportName: "buildEvmMultisignBodyMapleSyrupDeposit" },
|
|
1152
1192
|
inputZod: mcpMapleDepositInputSchema
|
|
1153
1193
|
}),
|
|
@@ -1158,7 +1198,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1158
1198
|
chainCategory: "evm",
|
|
1159
1199
|
description: "Build Maple PoolV2 requestRedeem batch.",
|
|
1160
1200
|
prerequisites: ["keyGen", "executorAddress", "pool address"],
|
|
1161
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1162
1201
|
handler: { importPath: "protocols/evm/maple", exportName: "buildEvmMultisignBodyMaplePoolRequestRedeem" },
|
|
1163
1202
|
inputZod: mcpMapleRequestRedeemInputSchema
|
|
1164
1203
|
}),
|
|
@@ -1169,7 +1208,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1169
1208
|
chainCategory: "evm",
|
|
1170
1209
|
description: "Build Sky Lockstake open/stake batch.",
|
|
1171
1210
|
prerequisites: ["keyGen", "executorAddress", "Ethereum mainnet RPC"],
|
|
1172
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1173
1211
|
handler: { importPath: "protocols/evm/sky", exportName: "buildSkyLockstakeStakePositionBatch" },
|
|
1174
1212
|
inputZod: mcpSkyLockstakeStakeInputSchema
|
|
1175
1213
|
}),
|
|
@@ -1180,7 +1218,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1180
1218
|
chainCategory: "evm",
|
|
1181
1219
|
description: "Build Lockstake draw (borrow USDS).",
|
|
1182
1220
|
prerequisites: ["keyGen", "executorAddress", "open urn"],
|
|
1183
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1184
1221
|
handler: { importPath: "protocols/evm/sky", exportName: "buildSkyLockstakeDrawBatch" },
|
|
1185
1222
|
inputZod: mcpSkyLockstakeDrawInputSchema
|
|
1186
1223
|
}),
|
|
@@ -1191,7 +1228,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1191
1228
|
chainCategory: "evm",
|
|
1192
1229
|
description: "Build Lockstake repay/wipe batch.",
|
|
1193
1230
|
prerequisites: ["keyGen", "executorAddress", "urn index"],
|
|
1194
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1195
1231
|
handler: { importPath: "protocols/evm/sky", exportName: "buildSkyLockstakeWipeBatch" },
|
|
1196
1232
|
inputZod: mcpSkyLockstakeWipeInputSchema
|
|
1197
1233
|
}),
|
|
@@ -1202,7 +1238,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1202
1238
|
chainCategory: "evm",
|
|
1203
1239
|
description: "Build Lockstake close position batch.",
|
|
1204
1240
|
prerequisites: ["keyGen", "executorAddress", "urn index"],
|
|
1205
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1206
1241
|
handler: { importPath: "protocols/evm/sky", exportName: "buildSkyLockstakeCloseBatch" },
|
|
1207
1242
|
inputZod: mcpSkyLockstakeCloseInputSchema
|
|
1208
1243
|
}),
|
|
@@ -1213,7 +1248,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1213
1248
|
chainCategory: "evm",
|
|
1214
1249
|
description: "Build Lockstake getReward batch.",
|
|
1215
1250
|
prerequisites: ["keyGen", "executorAddress", "urn index"],
|
|
1216
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1217
1251
|
handler: { importPath: "protocols/evm/sky", exportName: "buildSkyLockstakeGetRewardBatch" },
|
|
1218
1252
|
inputZod: mcpSkyLockstakeGetRewardInputSchema
|
|
1219
1253
|
}),
|
|
@@ -1224,7 +1258,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1224
1258
|
chainCategory: "evm",
|
|
1225
1259
|
description: "Build USDS \u2192 sUSDS ERC-4626 deposit batch.",
|
|
1226
1260
|
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
1227
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1228
1261
|
handler: { importPath: "protocols/evm/sky", exportName: "buildSkySusdsDepositFromUsdsBatch" },
|
|
1229
1262
|
inputZod: mcpSkySusdsDepositInputSchema
|
|
1230
1263
|
}),
|
|
@@ -1235,7 +1268,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1235
1268
|
chainCategory: "evm",
|
|
1236
1269
|
description: "Build sUSDS redeem to USDS batch.",
|
|
1237
1270
|
prerequisites: ["keyGen", "executorAddress", "RPC URL"],
|
|
1238
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1239
1271
|
handler: { importPath: "protocols/evm/sky", exportName: "buildSkySusdsRedeemToUsdsBatch" },
|
|
1240
1272
|
inputZod: mcpSkySusdsRedeemInputSchema
|
|
1241
1273
|
}),
|
|
@@ -1246,7 +1278,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1246
1278
|
chainCategory: "evm",
|
|
1247
1279
|
description: "Build Aave v4 Spoke supply/deposit batch (wrap native, approve, supply).",
|
|
1248
1280
|
prerequisites: ["keyGenId", "chainId", "underlying", "amountHuman", "get_defi_protocol_skill for hubs/spokes"],
|
|
1249
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1250
1281
|
handler: { importPath: "protocols/evm/aave-v4", exportName: "buildEvmMultisignBodyAaveV4DepositBatch" },
|
|
1251
1282
|
inputZod: mcpAaveV4DepositInputSchema
|
|
1252
1283
|
}),
|
|
@@ -1257,7 +1288,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1257
1288
|
chainCategory: "evm",
|
|
1258
1289
|
description: "Build Aave v4 Spoke withdraw; health-factor preview when user has borrow debt.",
|
|
1259
1290
|
prerequisites: ["keyGenId", "chainId", "underlying (supplied asset)", "amountHuman"],
|
|
1260
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1261
1291
|
handler: { importPath: "protocols/evm/aave-v4", exportName: "buildEvmMultisignBodyAaveV4SpokeWithdraw" },
|
|
1262
1292
|
inputZod: mcpAaveV4WithdrawInputSchema
|
|
1263
1293
|
}),
|
|
@@ -1274,7 +1304,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1274
1304
|
"amountHuman",
|
|
1275
1305
|
"collateral supplied via deposit"
|
|
1276
1306
|
],
|
|
1277
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1278
1307
|
handler: { importPath: "protocols/evm/aave-v4", exportName: "buildEvmMultisignBodyAaveV4SpokeBorrow" },
|
|
1279
1308
|
inputZod: mcpAaveV4BorrowInputSchema
|
|
1280
1309
|
}),
|
|
@@ -1285,7 +1314,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1285
1314
|
chainCategory: "evm",
|
|
1286
1315
|
description: "Build Aave v4 Spoke repay (approve if needed + repay).",
|
|
1287
1316
|
prerequisites: ["keyGenId", "chainId", "underlying (debt token)", "amountHuman"],
|
|
1288
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1289
1317
|
handler: { importPath: "protocols/evm/aave-v4", exportName: "buildEvmMultisignBodyAaveV4SpokeRepay" },
|
|
1290
1318
|
inputZod: mcpAaveV4RepayInputSchema
|
|
1291
1319
|
}),
|
|
@@ -1296,7 +1324,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1296
1324
|
chainCategory: "evm",
|
|
1297
1325
|
description: "Build Euler v2 vault deposit/lend batch.",
|
|
1298
1326
|
prerequisites: ["keyGen", "executorAddress", "vault address"],
|
|
1299
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1300
1327
|
handler: { importPath: "protocols/evm/euler-v2", exportName: "buildEvmMultisignBodyEulerV2IsolatedLendDepositBatch" },
|
|
1301
1328
|
inputZod: mcpEulerV2IsolatedLendInputSchema
|
|
1302
1329
|
}),
|
|
@@ -1307,7 +1334,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1307
1334
|
chainCategory: "evm",
|
|
1308
1335
|
description: "Build Euler v2 isolated borrow loop batch.",
|
|
1309
1336
|
prerequisites: ["keyGen", "executorAddress", "vault + collateral"],
|
|
1310
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1311
1337
|
handler: { importPath: "protocols/evm/euler-v2", exportName: "buildEvmMultisignBodyEulerV2IsolatedBorrowBatch" },
|
|
1312
1338
|
inputZod: mcpEulerV2IsolatedBorrowInputSchema
|
|
1313
1339
|
}),
|
|
@@ -1318,7 +1344,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1318
1344
|
chainCategory: "evm",
|
|
1319
1345
|
description: "Build Euler v2 vault withdraw/redeem batch.",
|
|
1320
1346
|
prerequisites: ["keyGen", "executorAddress", "vault address"],
|
|
1321
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1322
1347
|
handler: { importPath: "protocols/evm/euler-v2", exportName: "buildEvmMultisignBodyEulerV2VaultWithdraw" },
|
|
1323
1348
|
inputZod: mcpEulerV2VaultWithdrawInputSchema
|
|
1324
1349
|
}),
|
|
@@ -1329,7 +1354,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1329
1354
|
chainCategory: "evm",
|
|
1330
1355
|
description: "Build Euler v2 borrow repay batch.",
|
|
1331
1356
|
prerequisites: ["keyGen", "executorAddress", "vault address"],
|
|
1332
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1333
1357
|
handler: { importPath: "protocols/evm/euler-v2", exportName: "buildEvmMultisignBodyEulerV2BorrowRepayBatch" },
|
|
1334
1358
|
inputZod: mcpEulerV2BorrowRepayInputSchema
|
|
1335
1359
|
}),
|
|
@@ -1340,7 +1364,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1340
1364
|
chainCategory: "evm",
|
|
1341
1365
|
description: "Build Euler v2 borrow collateral deposit batch.",
|
|
1342
1366
|
prerequisites: ["keyGen", "executorAddress", "vault + collateral asset"],
|
|
1343
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1344
1367
|
handler: { importPath: "protocols/evm/euler-v2", exportName: "buildEvmMultisignBodyEulerV2BorrowCollateralDepositBatch" },
|
|
1345
1368
|
inputZod: mcpEulerV2CollateralDepositInputSchema
|
|
1346
1369
|
}),
|
|
@@ -1351,7 +1374,6 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1351
1374
|
chainCategory: "evm",
|
|
1352
1375
|
description: "Build Euler v2 borrow collateral withdraw batch.",
|
|
1353
1376
|
prerequisites: ["keyGen", "executorAddress", "vault + collateral asset"],
|
|
1354
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1355
1377
|
handler: { importPath: "protocols/evm/euler-v2", exportName: "buildEvmMultisignBodyEulerV2BorrowCollateralWithdrawBatch" },
|
|
1356
1378
|
inputZod: mcpEulerV2CollateralWithdrawInputSchema
|
|
1357
1379
|
}),
|
|
@@ -1360,9 +1382,8 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1360
1382
|
actionId: "gmx.increase",
|
|
1361
1383
|
protocolId: "gmx",
|
|
1362
1384
|
chainCategory: "evm",
|
|
1363
|
-
description: "
|
|
1385
|
+
description: "Create and submit mpc-auth multiSignRequest for GMX classic increase order (open/add perp). Keeper executes asynchronously after on-chain broadcast.",
|
|
1364
1386
|
prerequisites: ["keyGen", "executorAddress", "GMX market symbol", "classic mode only \u2014 no subaccounts"],
|
|
1365
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1366
1387
|
handler: { importPath: "protocols/evm/gmx", exportName: "buildEvmMultisignBodyGmxIncreaseBatch" },
|
|
1367
1388
|
inputZod: mcpGmxIncreaseInputSchema
|
|
1368
1389
|
}),
|
|
@@ -1371,9 +1392,8 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1371
1392
|
actionId: "gmx.decrease",
|
|
1372
1393
|
protocolId: "gmx",
|
|
1373
1394
|
chainCategory: "evm",
|
|
1374
|
-
description: "
|
|
1395
|
+
description: "Create and submit mpc-auth multiSignRequest for GMX classic decrease order (close/reduce perp).",
|
|
1375
1396
|
prerequisites: ["keyGen", "executorAddress", "position market symbol"],
|
|
1376
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1377
1397
|
handler: { importPath: "protocols/evm/gmx", exportName: "buildEvmMultisignBodyGmxDecreaseBatch" },
|
|
1378
1398
|
inputZod: mcpGmxDecreaseInputSchema
|
|
1379
1399
|
}),
|
|
@@ -1382,9 +1402,8 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1382
1402
|
actionId: "gmx.cancel",
|
|
1383
1403
|
protocolId: "gmx",
|
|
1384
1404
|
chainCategory: "evm",
|
|
1385
|
-
description: "
|
|
1405
|
+
description: "Create and submit mpc-auth multiSignRequest to cancel a pending GMX order (classic on-chain).",
|
|
1386
1406
|
prerequisites: ["keyGen", "executorAddress", "orderId from fetchOrders"],
|
|
1387
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1388
1407
|
handler: { importPath: "protocols/evm/gmx", exportName: "buildEvmMultisignBodyGmxCancelBatch" },
|
|
1389
1408
|
inputZod: mcpGmxCancelInputSchema
|
|
1390
1409
|
}),
|
|
@@ -1393,9 +1412,8 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1393
1412
|
actionId: "gmx.gmDeposit",
|
|
1394
1413
|
protocolId: "gmx",
|
|
1395
1414
|
chainCategory: "evm",
|
|
1396
|
-
description: "
|
|
1415
|
+
description: "Create and submit mpc-auth multiSignRequest for GMX GM pool deposit (ExchangeRouter multicall). Keeper executes asynchronously.",
|
|
1397
1416
|
prerequisites: ["keyGen", "executorAddress", "marketSymbol", "collateral token"],
|
|
1398
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1399
1417
|
handler: { importPath: "protocols/evm/gmx", exportName: "buildEvmMultisignBodyGmxGmDepositBatch" },
|
|
1400
1418
|
inputZod: mcpGmxGmDepositInputSchema
|
|
1401
1419
|
}),
|
|
@@ -1404,9 +1422,8 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1404
1422
|
actionId: "gmx.gmWithdraw",
|
|
1405
1423
|
protocolId: "gmx",
|
|
1406
1424
|
chainCategory: "evm",
|
|
1407
|
-
description: "
|
|
1425
|
+
description: "Create and submit mpc-auth multiSignRequest for GMX GM pool withdrawal (ExchangeRouter multicall). Keeper executes asynchronously.",
|
|
1408
1426
|
prerequisites: ["keyGen", "executorAddress", "GM market token balance"],
|
|
1409
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1410
1427
|
handler: { importPath: "protocols/evm/gmx", exportName: "buildEvmMultisignBodyGmxGmWithdrawBatch" },
|
|
1411
1428
|
inputZod: mcpGmxGmWithdrawInputSchema
|
|
1412
1429
|
}),
|
|
@@ -1415,9 +1432,8 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1415
1432
|
actionId: "gmx.stakeGmx",
|
|
1416
1433
|
protocolId: "gmx",
|
|
1417
1434
|
chainCategory: "evm",
|
|
1418
|
-
description: "
|
|
1435
|
+
description: "Create and submit mpc-auth multiSignRequest to stake GMX via RewardRouter.",
|
|
1419
1436
|
prerequisites: ["keyGen", "executorAddress", "GMX token balance"],
|
|
1420
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1421
1437
|
handler: { importPath: "protocols/evm/gmx", exportName: "buildEvmMultisignBodyGmxStakeGmxBatch" },
|
|
1422
1438
|
inputZod: mcpGmxStakeGmxInputSchema
|
|
1423
1439
|
}),
|
|
@@ -1426,9 +1442,8 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
|
|
|
1426
1442
|
actionId: "gmx.unstakeGmx",
|
|
1427
1443
|
protocolId: "gmx",
|
|
1428
1444
|
chainCategory: "evm",
|
|
1429
|
-
description: "
|
|
1445
|
+
description: "Create and submit mpc-auth multiSignRequest to unstake GMX via RewardRouter.",
|
|
1430
1446
|
prerequisites: ["keyGen", "executorAddress", "staked GMX balance"],
|
|
1431
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1432
1447
|
handler: { importPath: "protocols/evm/gmx", exportName: "buildEvmMultisignBodyGmxUnstakeGmxBatch" },
|
|
1433
1448
|
inputZod: mcpGmxUnstakeGmxInputSchema
|
|
1434
1449
|
})
|
|
@@ -1444,6 +1459,15 @@ function defineMcpTool(def) {
|
|
|
1444
1459
|
parseOutput: (data) => def.outputZod.parse(data)
|
|
1445
1460
|
};
|
|
1446
1461
|
}
|
|
1462
|
+
function defineMultisignSubmitMcpTool(def) {
|
|
1463
|
+
const meta = withMultisignSubmitMcpMeta(def.description, def.followUp ?? MCP_MULTISIGN_SUBMIT_FOLLOW_UP);
|
|
1464
|
+
return defineMcpTool({
|
|
1465
|
+
...def,
|
|
1466
|
+
description: meta.description,
|
|
1467
|
+
followUp: meta.followUp,
|
|
1468
|
+
outputZod: mcpServerSubmitOutputSchema
|
|
1469
|
+
});
|
|
1470
|
+
}
|
|
1447
1471
|
var CORE_MCP_TOOL_DEFINITIONS = [
|
|
1448
1472
|
defineMcpTool({
|
|
1449
1473
|
name: "ctm_uniswap_v4_quote",
|
|
@@ -1476,20 +1500,18 @@ var CORE_MCP_TOOL_DEFINITIONS = [
|
|
|
1476
1500
|
inputZod: mcpUniswapV4CreateSwapInputSchema,
|
|
1477
1501
|
outputZod: mcpUniswapV4CreateSwapOutputSchema
|
|
1478
1502
|
}),
|
|
1479
|
-
|
|
1503
|
+
defineMultisignSubmitMcpTool({
|
|
1480
1504
|
name: "ctm_uniswap_v4_build_swap_multisign",
|
|
1481
1505
|
actionId: "uniswap-v4.swap-exact-input",
|
|
1482
1506
|
protocolId: "uniswap-v4",
|
|
1483
1507
|
chainCategory: "evm",
|
|
1484
|
-
description: "
|
|
1508
|
+
description: "Create and submit mpc-auth multiSignRequest for a Uniswap V4 swap. May batch 1\u20133 EVM txs: ERC-20 approve(s) + Universal Router swap (or 1 tx for native-in).",
|
|
1485
1509
|
prerequisites: [
|
|
1486
1510
|
"ctm_uniswap_v4_create_swap output + matching quote snapshot and swapDeadlineUnix",
|
|
1487
1511
|
"keyGenId + chainId + purposeText"
|
|
1488
1512
|
],
|
|
1489
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest with clientSig and signedMessage"],
|
|
1490
1513
|
handler: { importPath: "protocols/evm/uniswap-v4", exportName: "buildEvmMultisignBodyUniswapV4SkipPermit2Batch" },
|
|
1491
|
-
inputZod: mcpUniswapV4BuildSwapMultisignInputSchema
|
|
1492
|
-
outputZod: multisignOutputSchema
|
|
1514
|
+
inputZod: mcpUniswapV4BuildSwapMultisignInputSchema
|
|
1493
1515
|
}),
|
|
1494
1516
|
defineMcpTool({
|
|
1495
1517
|
name: "ctm_uniswap_v4_list_lp_pools",
|
|
@@ -1519,24 +1541,22 @@ var CORE_MCP_TOOL_DEFINITIONS = [
|
|
|
1519
1541
|
inputZod: mcpUniswapV4LpCreatePositionInputSchema,
|
|
1520
1542
|
outputZod: mcpUniswapV4LpCreatePositionOutputSchema
|
|
1521
1543
|
}),
|
|
1522
|
-
|
|
1544
|
+
defineMultisignSubmitMcpTool({
|
|
1523
1545
|
name: "ctm_uniswap_v4_build_mint_liquidity_multisign",
|
|
1524
1546
|
actionId: "uniswap-v4.mint-liquidity",
|
|
1525
1547
|
protocolId: "uniswap-v4",
|
|
1526
1548
|
chainCategory: "evm",
|
|
1527
|
-
description: "
|
|
1549
|
+
description: "Create and submit mpc-auth multiSignRequest for minting a Uniswap V4 LP position. Batches ERC-20 approve(s) + Position Manager tx from LP create response.",
|
|
1528
1550
|
prerequisites: ["ctm_uniswap_v4_lp_create_position output", "keyGenId + chainId + purposeText"],
|
|
1529
1551
|
followUp: [
|
|
1530
|
-
|
|
1531
|
-
"
|
|
1532
|
-
"After execute: ctm_uniswap_v4_register_position_from_mint_tx (mint tx hash)"
|
|
1552
|
+
...MCP_MULTISIGN_SUBMIT_FOLLOW_UP,
|
|
1553
|
+
"After broadcast: ctm_uniswap_v4_register_position_from_mint_tx (mint tx hash)"
|
|
1533
1554
|
],
|
|
1534
1555
|
handler: {
|
|
1535
1556
|
importPath: "protocols/evm/uniswap-v4",
|
|
1536
1557
|
exportName: "buildEvmMultisignBodyUniswapV4MintLiquidityBatch"
|
|
1537
1558
|
},
|
|
1538
|
-
inputZod: mcpUniswapV4BuildMintLiquidityMultisignInputSchema
|
|
1539
|
-
outputZod: multisignOutputSchema
|
|
1559
|
+
inputZod: mcpUniswapV4BuildMintLiquidityMultisignInputSchema
|
|
1540
1560
|
}),
|
|
1541
1561
|
defineMcpTool({
|
|
1542
1562
|
name: "ctm_uniswap_v4_lp_increase",
|
|
@@ -1550,20 +1570,18 @@ var CORE_MCP_TOOL_DEFINITIONS = [
|
|
|
1550
1570
|
inputZod: mcpUniswapV4LpIncreaseInputSchema,
|
|
1551
1571
|
outputZod: mcpUniswapV4LpIncreaseOutputSchema
|
|
1552
1572
|
}),
|
|
1553
|
-
|
|
1573
|
+
defineMultisignSubmitMcpTool({
|
|
1554
1574
|
name: "ctm_uniswap_v4_build_increase_liquidity_multisign",
|
|
1555
1575
|
actionId: "uniswap-v4.increase-liquidity",
|
|
1556
1576
|
protocolId: "uniswap-v4",
|
|
1557
1577
|
chainCategory: "evm",
|
|
1558
|
-
description: "
|
|
1578
|
+
description: "Create and submit mpc-auth multiSignRequest to increase Uniswap V4 position liquidity.",
|
|
1559
1579
|
prerequisites: ["ctm_uniswap_v4_lp_increase output"],
|
|
1560
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1561
1580
|
handler: {
|
|
1562
1581
|
importPath: "protocols/evm/uniswap-v4",
|
|
1563
1582
|
exportName: "buildEvmMultisignBodyUniswapV4IncreaseLiquidityBatch"
|
|
1564
1583
|
},
|
|
1565
|
-
inputZod: mcpUniswapV4BuildIncreaseLiquidityMultisignInputSchema
|
|
1566
|
-
outputZod: multisignOutputSchema
|
|
1584
|
+
inputZod: mcpUniswapV4BuildIncreaseLiquidityMultisignInputSchema
|
|
1567
1585
|
}),
|
|
1568
1586
|
defineMcpTool({
|
|
1569
1587
|
name: "ctm_uniswap_v4_lp_decrease",
|
|
@@ -1577,20 +1595,18 @@ var CORE_MCP_TOOL_DEFINITIONS = [
|
|
|
1577
1595
|
inputZod: mcpUniswapV4LpDecreaseInputSchema,
|
|
1578
1596
|
outputZod: mcpUniswapV4LpDecreaseOutputSchema
|
|
1579
1597
|
}),
|
|
1580
|
-
|
|
1598
|
+
defineMultisignSubmitMcpTool({
|
|
1581
1599
|
name: "ctm_uniswap_v4_build_decrease_liquidity_multisign",
|
|
1582
1600
|
actionId: "uniswap-v4.decrease-liquidity",
|
|
1583
1601
|
protocolId: "uniswap-v4",
|
|
1584
1602
|
chainCategory: "evm",
|
|
1585
|
-
description: "
|
|
1603
|
+
description: "Create and submit mpc-auth multiSignRequest to decrease Uniswap V4 position liquidity.",
|
|
1586
1604
|
prerequisites: ["ctm_uniswap_v4_lp_decrease output"],
|
|
1587
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1588
1605
|
handler: {
|
|
1589
1606
|
importPath: "protocols/evm/uniswap-v4",
|
|
1590
1607
|
exportName: "buildEvmMultisignBodyUniswapV4DecreaseLiquidityBatch"
|
|
1591
1608
|
},
|
|
1592
|
-
inputZod: mcpUniswapV4BuildDecreaseLiquidityMultisignInputSchema
|
|
1593
|
-
outputZod: multisignOutputSchema
|
|
1609
|
+
inputZod: mcpUniswapV4BuildDecreaseLiquidityMultisignInputSchema
|
|
1594
1610
|
}),
|
|
1595
1611
|
defineMcpTool({
|
|
1596
1612
|
name: "ctm_uniswap_v4_lp_collect",
|
|
@@ -1604,20 +1620,18 @@ var CORE_MCP_TOOL_DEFINITIONS = [
|
|
|
1604
1620
|
inputZod: mcpUniswapV4LpClaimInputSchema,
|
|
1605
1621
|
outputZod: mcpUniswapV4LpClaimOutputSchema
|
|
1606
1622
|
}),
|
|
1607
|
-
|
|
1623
|
+
defineMultisignSubmitMcpTool({
|
|
1608
1624
|
name: "ctm_uniswap_v4_build_collect_fees_multisign",
|
|
1609
1625
|
actionId: "uniswap-v4.collect-fees",
|
|
1610
1626
|
protocolId: "uniswap-v4",
|
|
1611
1627
|
chainCategory: "evm",
|
|
1612
|
-
description: "
|
|
1628
|
+
description: "Create and submit mpc-auth multiSignRequest to collect fees from a Uniswap V4 position.",
|
|
1613
1629
|
prerequisites: ["ctm_uniswap_v4_lp_collect output"],
|
|
1614
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest"],
|
|
1615
1630
|
handler: {
|
|
1616
1631
|
importPath: "protocols/evm/uniswap-v4",
|
|
1617
1632
|
exportName: "buildEvmMultisignBodyUniswapV4CollectFeesBatch"
|
|
1618
1633
|
},
|
|
1619
|
-
inputZod: mcpUniswapV4BuildCollectFeesMultisignInputSchema
|
|
1620
|
-
outputZod: multisignOutputSchema
|
|
1634
|
+
inputZod: mcpUniswapV4BuildCollectFeesMultisignInputSchema
|
|
1621
1635
|
}),
|
|
1622
1636
|
defineMcpTool({
|
|
1623
1637
|
name: "ctm_uniswap_v4_lp_list_positions",
|
|
@@ -1680,21 +1694,19 @@ var CORE_MCP_TOOL_DEFINITIONS = [
|
|
|
1680
1694
|
inputZod: mcpCurveDaoQuoteInputSchema,
|
|
1681
1695
|
outputZod: mcpCurveDaoQuoteOutputSchema
|
|
1682
1696
|
}),
|
|
1683
|
-
|
|
1697
|
+
defineMultisignSubmitMcpTool({
|
|
1684
1698
|
name: "ctm_curve_dao_build_swap_multisign",
|
|
1685
1699
|
actionId: "curve-dao.swap",
|
|
1686
1700
|
protocolId: "curve-dao",
|
|
1687
1701
|
chainCategory: "evm",
|
|
1688
|
-
description: "
|
|
1702
|
+
description: "Create and submit mpc-auth multiSignRequest for a Curve Router NG swap via @curvefi/api populateSwap. Optionally batches ERC-20 approve txs when allowance is insufficient, then exchange.",
|
|
1689
1703
|
prerequisites: [
|
|
1690
1704
|
"ctm_curve_dao_quote (recommended)",
|
|
1691
1705
|
"keyGenId + chainId + purposeText + slippagePercent (0\u2013100 exclusive)",
|
|
1692
1706
|
"get_defi_protocol_skill for tokenIn address rules"
|
|
1693
1707
|
],
|
|
1694
|
-
followUp: ["Sign messageToSign", "POST /multiSignRequest with clientSig and signedMessage"],
|
|
1695
1708
|
handler: { importPath: "protocols/evm/curve-dao", exportName: "buildEvmMultisignBodyCurveDaoBatch" },
|
|
1696
|
-
inputZod: mcpCurveDaoBuildSwapMultisignInputSchema
|
|
1697
|
-
outputZod: multisignOutputSchema
|
|
1709
|
+
inputZod: mcpCurveDaoBuildSwapMultisignInputSchema
|
|
1698
1710
|
}),
|
|
1699
1711
|
defineMcpTool({
|
|
1700
1712
|
name: "ctm_gmx_fetch_markets",
|
|
@@ -1822,6 +1834,7 @@ function getAgentCatalogForMcp() {
|
|
|
1822
1834
|
protocols: getProtocolModules(),
|
|
1823
1835
|
commonParams: EVM_COMMON_PARAM_DOCS,
|
|
1824
1836
|
multisignOutput: MULTISIGN_OUTPUT_DOC,
|
|
1837
|
+
multisignSubmitOutput: MULTISIGN_SUBMIT_OUTPUT_DOC,
|
|
1825
1838
|
managementSig: MANAGEMENT_SIG_DOC,
|
|
1826
1839
|
/** Zod schemas for MCP tool I/O — source of truth for continuum-mcp-server validation. */
|
|
1827
1840
|
inputSchemas: MCP_TOOL_INPUT_SCHEMAS,
|
|
@@ -1830,9 +1843,14 @@ function getAgentCatalogForMcp() {
|
|
|
1830
1843
|
evmSwapTypical: [
|
|
1831
1844
|
"1. Quote (protocol-specific API if needed)",
|
|
1832
1845
|
"2. Build protocol calldata (e.g. create_swap)",
|
|
1833
|
-
"3. build_*_multisign \u2192 {
|
|
1834
|
-
"4.
|
|
1835
|
-
|
|
1846
|
+
"3. build_*_multisign \u2192 { requestId } (MCP auto-submits)",
|
|
1847
|
+
"4. wait_for_sign_request_ready \u2192 sign_request_agree \u2192 trigger_sign_result \u2192 broadcast_sign_result"
|
|
1848
|
+
],
|
|
1849
|
+
evmSwapManualTypical: [
|
|
1850
|
+
"1. Quote (protocol-specific API if needed)",
|
|
1851
|
+
"2. Build protocol calldata",
|
|
1852
|
+
"3. Protocol builder \u2192 { bodyForSign, messageToSign } (node app only)",
|
|
1853
|
+
"4. Sign messageToSign and POST /multiSignRequest with clientSig and signedMessage"
|
|
1836
1854
|
],
|
|
1837
1855
|
managementPostTypical: [
|
|
1838
1856
|
"1. GET /getNodeKey \u2192 nodeKey (128 hex)",
|
|
@@ -2180,8 +2198,8 @@ var require2 = module$1.createRequire(url.fileURLToPath((typeof document === 'un
|
|
|
2180
2198
|
var { GmxApiSdk } = require2("@gmx-io/sdk/v2");
|
|
2181
2199
|
var GMX_HTTP_TIMEOUT_MS = 3e4;
|
|
2182
2200
|
var GMX_API_BASE_URLS = {
|
|
2183
|
-
42161: ["https://arbitrum.gmxapi.io
|
|
2184
|
-
43114: ["https://avalanche.gmxapi.io
|
|
2201
|
+
42161: ["https://arbitrum.gmxapi.io", "https://arbitrum.gmxapi.ai"],
|
|
2202
|
+
43114: ["https://avalanche.gmxapi.io", "https://avalanche.gmxapi.ai"]
|
|
2185
2203
|
};
|
|
2186
2204
|
function buildGmxUrl(baseUrl, path, query) {
|
|
2187
2205
|
const base = baseUrl.replace(/\/$/, "");
|
|
@@ -2410,12 +2428,26 @@ var SKILL_PROTOCOL_IDS = [
|
|
|
2410
2428
|
function getToolsForProtocol(protocolId) {
|
|
2411
2429
|
return MCP_TOOL_DEFINITIONS.filter((t) => t.protocolId === protocolId);
|
|
2412
2430
|
}
|
|
2431
|
+
function readSharedMultisignMcpGasSection() {
|
|
2432
|
+
try {
|
|
2433
|
+
return fs.readFileSync(path.join(skillsDir, "_shared", "multisign-mcp-gas.md"), "utf8").trim();
|
|
2434
|
+
} catch {
|
|
2435
|
+
return "";
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2413
2438
|
function getProtocolSkill(protocolId) {
|
|
2414
2439
|
if (!SKILL_PROTOCOL_IDS.includes(protocolId)) {
|
|
2415
2440
|
return void 0;
|
|
2416
2441
|
}
|
|
2417
2442
|
try {
|
|
2418
|
-
|
|
2443
|
+
const skill = fs.readFileSync(path.join(skillsDir, protocolId, "SKILL.md"), "utf8").trim();
|
|
2444
|
+
const shared = readSharedMultisignMcpGasSection();
|
|
2445
|
+
if (!shared) return skill;
|
|
2446
|
+
if (skill.includes("## Gas and MCP submit")) return skill;
|
|
2447
|
+
return `${skill}
|
|
2448
|
+
|
|
2449
|
+
${shared}
|
|
2450
|
+
`;
|
|
2419
2451
|
} catch {
|
|
2420
2452
|
return void 0;
|
|
2421
2453
|
}
|
|
@@ -2674,22 +2706,6 @@ function getProtocolSupportAdvisor(protocolId) {
|
|
|
2674
2706
|
function listProtocolSupportAdvisorIds() {
|
|
2675
2707
|
return Object.keys(PROTOCOL_SUPPORT_ADVISORS);
|
|
2676
2708
|
}
|
|
2677
|
-
var mcpServerCommonInputSchema = zod.z.object({
|
|
2678
|
-
keyGenId: zod.z.string().min(1).describe("KeyGen id from fetch_key_gen_result / node preferred KeyGen"),
|
|
2679
|
-
chainId: zod.z.number().int().positive().describe("EVM chain id; RPC and gas config resolved from chain registry"),
|
|
2680
|
-
purposeText: zod.z.string().min(1).describe("Human-readable purpose for the sign request"),
|
|
2681
|
-
useCustomGas: zod.z.boolean().optional().describe("Apply chain gas settings from registry when true")
|
|
2682
|
-
});
|
|
2683
|
-
function mcpServerMultisignInput(fields) {
|
|
2684
|
-
return mcpServerCommonInputSchema.extend(fields);
|
|
2685
|
-
}
|
|
2686
|
-
var mcpServerSubmitOutputSchema = zod.z.object({
|
|
2687
|
-
requestId: zod.z.string().min(1)
|
|
2688
|
-
}).describe("mpc-auth multiSignRequest id; continue with trigger_sign_result / broadcast_sign_result");
|
|
2689
|
-
var MCP_NON_SUBMIT_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
2690
|
-
"ctm_uniswap_v4_quote",
|
|
2691
|
-
"ctm_uniswap_v4_create_swap"
|
|
2692
|
-
]);
|
|
2693
2709
|
|
|
2694
2710
|
// src/agent/catalog.ts
|
|
2695
2711
|
registerProtocolModule(uniswapV4ProtocolModule);
|
|
@@ -2730,6 +2746,7 @@ exports.MCP_TOOL_DEFINITIONS = MCP_TOOL_DEFINITIONS;
|
|
|
2730
2746
|
exports.MCP_TOOL_INPUT_SCHEMAS = MCP_TOOL_INPUT_SCHEMAS;
|
|
2731
2747
|
exports.MCP_TOOL_OUTPUT_SCHEMAS = MCP_TOOL_OUTPUT_SCHEMAS;
|
|
2732
2748
|
exports.MULTISIGN_OUTPUT_DOC = MULTISIGN_OUTPUT_DOC;
|
|
2749
|
+
exports.MULTISIGN_SUBMIT_OUTPUT_DOC = MULTISIGN_SUBMIT_OUTPUT_DOC;
|
|
2733
2750
|
exports.PROTOCOL_SUPPORT_ADVISORS = PROTOCOL_SUPPORT_ADVISORS;
|
|
2734
2751
|
exports.chainDetailSchema = chainDetailSchema;
|
|
2735
2752
|
exports.evmAddressSchema = evmAddressSchema;
|
|
@@ -2786,7 +2803,7 @@ exports.mcpGmxFetchStakingPowerOutputSchema = mcpGmxFetchStakingPowerOutputSchem
|
|
|
2786
2803
|
exports.mcpGmxGmDepositInputSchema = mcpGmxGmDepositInputSchema;
|
|
2787
2804
|
exports.mcpGmxGmWithdrawInputSchema = mcpGmxGmWithdrawInputSchema;
|
|
2788
2805
|
exports.mcpGmxIncreaseInputSchema = mcpGmxIncreaseInputSchema;
|
|
2789
|
-
exports.mcpGmxMultisignOutputSchema =
|
|
2806
|
+
exports.mcpGmxMultisignOutputSchema = mcpServerSubmitOutputSchema;
|
|
2790
2807
|
exports.mcpGmxStakeGmxInputSchema = mcpGmxStakeGmxInputSchema;
|
|
2791
2808
|
exports.mcpGmxUnstakeGmxInputSchema = mcpGmxUnstakeGmxInputSchema;
|
|
2792
2809
|
exports.mcpLidoClaimWithdrawalInputSchema = mcpLidoClaimWithdrawalInputSchema;
|
|
@@ -2798,6 +2815,7 @@ exports.mcpMapleDepositInputSchema = mcpMapleDepositInputSchema;
|
|
|
2798
2815
|
exports.mcpMapleRequestRedeemInputSchema = mcpMapleRequestRedeemInputSchema;
|
|
2799
2816
|
exports.mcpMultisignInput = mcpMultisignInput;
|
|
2800
2817
|
exports.mcpMultisignOutputSchema = multisignOutputSchema;
|
|
2818
|
+
exports.mcpMultisignSubmitOutputSchema = mcpServerSubmitOutputSchema;
|
|
2801
2819
|
exports.mcpServerCommonInputSchema = mcpServerCommonInputSchema;
|
|
2802
2820
|
exports.mcpServerMultisignInput = mcpServerMultisignInput;
|
|
2803
2821
|
exports.mcpServerSubmitOutputSchema = mcpServerSubmitOutputSchema;
|
|
@@ -2836,6 +2854,7 @@ exports.mcpUniswapV4RegisterPositionNftOutputSchema = mcpUniswapV4RegisterPositi
|
|
|
2836
2854
|
exports.multisignOutputSchema = multisignOutputSchema;
|
|
2837
2855
|
exports.parseMcpToolInput = parseMcpToolInput;
|
|
2838
2856
|
exports.parseMcpToolOutput = parseMcpToolOutput;
|
|
2857
|
+
exports.parseMultisignBuilderOutput = parseMultisignBuilderOutput;
|
|
2839
2858
|
exports.uniswapQuoteTradeTypeSchema = uniswapQuoteTradeTypeSchema;
|
|
2840
2859
|
exports.zodSchemaToMcpJsonSchema = zodSchemaToMcpJsonSchema;
|
|
2841
2860
|
//# sourceMappingURL=catalog.cjs.map
|