@continuumdao/ctm-mpc-defi 0.2.3 → 0.2.5

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.
@@ -133,6 +133,52 @@ var uniswapV4ProtocolModule = {
133
133
  amount: { type: "string", required: true, description: "Amount for quote" },
134
134
  type: { type: "EXACT_INPUT | EXACT_OUTPUT", required: true, description: "Trade type" }
135
135
  }
136
+ },
137
+ {
138
+ id: "uniswap-v4.mint-liquidity",
139
+ protocolId: UNISWAP_V4_PROTOCOL_ID,
140
+ chainCategory: "evm",
141
+ description: "Mint a new Uniswap V4 concentrated liquidity position (Position Manager NFT)",
142
+ commonParams: ["keyGen", "purposeText", "useCustomGas"],
143
+ params: {
144
+ lpResponse: { type: "object", required: true, description: "Full LP API create response" },
145
+ nativeWrapped: { type: "address", required: false, description: "WETH when pool uses native ETH" },
146
+ poolReference: { type: "string", required: false, description: "V4 pool id" },
147
+ uniswapApiKey: { type: "string", required: true, description: "Uniswap API key" }
148
+ }
149
+ },
150
+ {
151
+ id: "uniswap-v4.increase-liquidity",
152
+ protocolId: UNISWAP_V4_PROTOCOL_ID,
153
+ chainCategory: "evm",
154
+ description: "Increase liquidity on an existing Uniswap V4 position NFT",
155
+ commonParams: ["keyGen", "purposeText", "useCustomGas"],
156
+ params: {
157
+ nftTokenId: { type: "string", required: true, description: "Position NFT token id" },
158
+ lpResponse: { type: "object", required: true, description: "Full LP API increase response" }
159
+ }
160
+ },
161
+ {
162
+ id: "uniswap-v4.decrease-liquidity",
163
+ protocolId: UNISWAP_V4_PROTOCOL_ID,
164
+ chainCategory: "evm",
165
+ description: "Decrease liquidity on an existing Uniswap V4 position NFT",
166
+ commonParams: ["keyGen", "purposeText", "useCustomGas"],
167
+ params: {
168
+ nftTokenId: { type: "string", required: true, description: "Position NFT token id" },
169
+ lpResponse: { type: "object", required: true, description: "Full LP API decrease response" }
170
+ }
171
+ },
172
+ {
173
+ id: "uniswap-v4.collect-fees",
174
+ protocolId: UNISWAP_V4_PROTOCOL_ID,
175
+ chainCategory: "evm",
176
+ description: "Collect accrued fees from a Uniswap V4 position NFT",
177
+ commonParams: ["keyGen", "purposeText", "useCustomGas"],
178
+ params: {
179
+ nftTokenId: { type: "string", required: true, description: "Position NFT token id" },
180
+ lpResponse: { type: "object", required: true, description: "Full LP API claim response" }
181
+ }
136
182
  }
137
183
  ]
138
184
  };
@@ -523,6 +569,160 @@ var mcpUniswapV4BuildSwapMultisignInputSchema = evmMultisignCommonInputSchema.ex
523
569
  swapDeadlineUnix: zod.z.number().describe("Same deadline passed to create_swap"),
524
570
  slippagePercent: zod.z.number().optional().describe("Extra approve headroom for EXACT_OUTPUT")
525
571
  });
572
+ var lpExistingPoolSchema = zod.z.object({
573
+ token0Address: evmAddressSchema,
574
+ token1Address: evmAddressSchema,
575
+ poolReference: zod.z.string().min(1).describe("V4 pool id (bytes32 hex)")
576
+ });
577
+ var lpNewPoolSchema = zod.z.object({
578
+ token0Address: evmAddressSchema,
579
+ token1Address: evmAddressSchema,
580
+ fee: zod.z.number().int().nonnegative(),
581
+ tickSpacing: zod.z.number().int().positive(),
582
+ hooks: evmAddressSchema.optional(),
583
+ initialPrice: zod.z.string().min(1).describe("sqrtRatioX96 string for new pool")
584
+ });
585
+ var lpIndependentTokenSchema = zod.z.object({
586
+ tokenAddress: evmAddressSchema.describe("0x0 for native ETH"),
587
+ amount: zod.z.string().min(1).describe("Amount in token base units (wei)")
588
+ });
589
+ var lpPriceBoundsSchema = zod.z.object({
590
+ minPrice: zod.z.string().min(1),
591
+ maxPrice: zod.z.string().min(1)
592
+ });
593
+ var lpTickBoundsSchema = zod.z.object({
594
+ tickLower: zod.z.number().int(),
595
+ tickUpper: zod.z.number().int()
596
+ });
597
+ var lpCommonApiInputSchema = zod.z.object({
598
+ uniswapApiKey: zod.z.string().min(1),
599
+ walletAddress: evmAddressSchema.optional(),
600
+ chainId: zod.z.union([zod.z.number().int().positive(), zod.z.string().min(1)]),
601
+ slippageTolerance: zod.z.number().optional(),
602
+ simulateTransaction: zod.z.boolean().optional(),
603
+ baseUrl: zod.z.string().optional(),
604
+ keyGen: zod.z.string().optional(),
605
+ managementNodeUrl: zod.z.string().optional()
606
+ });
607
+ var mcpUniswapV4LpCreatePositionInputSchema = lpCommonApiInputSchema.extend({
608
+ existingPool: lpExistingPoolSchema.optional(),
609
+ newPool: lpNewPoolSchema.optional(),
610
+ independentToken: lpIndependentTokenSchema,
611
+ priceBounds: lpPriceBoundsSchema.optional(),
612
+ tickBounds: lpTickBoundsSchema.optional()
613
+ });
614
+ var mcpUniswapV4LpListPoolsInputSchema = zod.z.object({
615
+ chainId: zod.z.union([zod.z.number().int().positive(), zod.z.string().min(1)]),
616
+ pair: zod.z.string().optional().describe("Optional filter, e.g. eth-usdc or ETH/USDC")
617
+ });
618
+ var mcpUniswapV4LpListPoolsOutputSchema = zod.z.object({
619
+ chainId: zod.z.number().int().positive(),
620
+ chainLabel: zod.z.string(),
621
+ pools: zod.z.array(
622
+ zod.z.object({
623
+ presetId: zod.z.string(),
624
+ pairSlug: zod.z.string(),
625
+ pairLabel: zod.z.string(),
626
+ fee: zod.z.number().int(),
627
+ feeLabel: zod.z.string(),
628
+ tickSpacing: zod.z.number().int(),
629
+ token0Symbol: zod.z.string(),
630
+ token1Symbol: zod.z.string(),
631
+ token0Address: evmAddressSchema,
632
+ token1Address: evmAddressSchema,
633
+ poolReference: zod.z.string(),
634
+ hooks: evmAddressSchema,
635
+ nativeWrapped: evmAddressSchema.optional(),
636
+ usesNativeEth: zod.z.boolean()
637
+ })
638
+ ),
639
+ notes: zod.z.string()
640
+ });
641
+ var mcpUniswapV4LpCreatePositionOutputSchema = jsonObjectSchema;
642
+ var mcpUniswapV4LpIncreaseInputSchema = lpCommonApiInputSchema.extend({
643
+ token0Address: evmAddressSchema,
644
+ token1Address: evmAddressSchema,
645
+ nftTokenId: zod.z.union([zod.z.string(), zod.z.number()]),
646
+ independentToken: lpIndependentTokenSchema
647
+ });
648
+ var mcpUniswapV4LpIncreaseOutputSchema = jsonObjectSchema;
649
+ var mcpUniswapV4LpDecreaseInputSchema = lpCommonApiInputSchema.extend({
650
+ token0Address: evmAddressSchema,
651
+ token1Address: evmAddressSchema,
652
+ nftTokenId: zod.z.union([zod.z.string(), zod.z.number()]),
653
+ liquidityPercentageToDecrease: zod.z.number().int().min(1).max(100)
654
+ });
655
+ var mcpUniswapV4LpDecreaseOutputSchema = jsonObjectSchema;
656
+ var mcpUniswapV4LpClaimInputSchema = lpCommonApiInputSchema.extend({
657
+ tokenId: zod.z.union([zod.z.string(), zod.z.number()])
658
+ });
659
+ var mcpUniswapV4LpClaimOutputSchema = jsonObjectSchema;
660
+ var mcpUniswapV4LpListPositionsInputSchema = zod.z.object({
661
+ chainId: zod.z.union([zod.z.number().int().positive(), zod.z.string().min(1)]),
662
+ keyGenId: zod.z.string().min(1).optional(),
663
+ walletAddress: evmAddressSchema.optional(),
664
+ positionManagerAddress: evmAddressSchema.optional()
665
+ });
666
+ var mcpUniswapV4LpListPositionsOutputSchema = zod.z.object({
667
+ source: zod.z.literal("token_registry"),
668
+ positions: zod.z.array(
669
+ zod.z.object({
670
+ tokenId: zod.z.string(),
671
+ positionManager: evmAddressSchema,
672
+ owner: evmAddressSchema,
673
+ name: zod.z.string().optional(),
674
+ symbol: zod.z.string().optional()
675
+ })
676
+ )
677
+ });
678
+ var mcpUniswapV4RegisterPositionNftInputSchema = zod.z.object({
679
+ chainId: zod.z.union([zod.z.number().int().positive(), zod.z.string().min(1)]),
680
+ tokenId: zod.z.union([zod.z.string(), zod.z.number()]),
681
+ keyGenId: zod.z.string().min(1).optional(),
682
+ positionManagerAddress: evmAddressSchema.optional(),
683
+ name: zod.z.string().optional(),
684
+ symbol: zod.z.string().optional(),
685
+ tokenURI: zod.z.string().optional()
686
+ });
687
+ var mcpUniswapV4RegisterPositionNftOutputSchema = zod.z.object({
688
+ message: zod.z.string(),
689
+ tokenId: zod.z.string(),
690
+ positionManager: evmAddressSchema
691
+ });
692
+ var mcpUniswapV4RegisterPositionFromMintTxInputSchema = zod.z.object({
693
+ chainId: zod.z.union([zod.z.number().int().positive(), zod.z.string().min(1)]),
694
+ txHash: zod.z.string().min(1),
695
+ keyGenId: zod.z.string().min(1).optional(),
696
+ walletAddress: evmAddressSchema.optional(),
697
+ rpcUrl: zod.z.string().optional(),
698
+ positionManagerAddress: evmAddressSchema.optional()
699
+ });
700
+ var mcpUniswapV4RegisterPositionFromMintTxOutputSchema = zod.z.object({
701
+ message: zod.z.string(),
702
+ tokenId: zod.z.string(),
703
+ positionManager: evmAddressSchema,
704
+ registered: zod.z.boolean()
705
+ });
706
+ var lpBuildCommonSchema = {
707
+ lpResponse: jsonObjectSchema.describe("Full LP API response (create/increase/decrease/claim)"),
708
+ nativeWrapped: evmAddressSchema.optional(),
709
+ poolReference: zod.z.string().optional()
710
+ };
711
+ var mcpUniswapV4BuildMintLiquidityMultisignInputSchema = evmMultisignCommonInputSchema.extend(
712
+ lpBuildCommonSchema
713
+ );
714
+ var mcpUniswapV4BuildIncreaseLiquidityMultisignInputSchema = evmMultisignCommonInputSchema.extend({
715
+ ...lpBuildCommonSchema,
716
+ nftTokenId: zod.z.union([zod.z.string(), zod.z.number()])
717
+ });
718
+ var mcpUniswapV4BuildDecreaseLiquidityMultisignInputSchema = evmMultisignCommonInputSchema.extend({
719
+ ...lpBuildCommonSchema,
720
+ nftTokenId: zod.z.union([zod.z.string(), zod.z.number()])
721
+ });
722
+ var mcpUniswapV4BuildCollectFeesMultisignInputSchema = evmMultisignCommonInputSchema.extend({
723
+ ...lpBuildCommonSchema,
724
+ nftTokenId: zod.z.union([zod.z.string(), zod.z.number()])
725
+ });
526
726
  var mcpCurveDaoQuoteInputSchema = zod.z.object({
527
727
  chainId: zod.z.number().int().positive().describe("EVM chain id (rpcUrl resolved from get_chain_registry rpcGateway)"),
528
728
  rpcUrl: zod.z.string().min(1).optional().describe("JSON-RPC URL; continuum-mcp-server injects from chain registry \u2014 do not pass a public RPC URL"),
@@ -611,29 +811,44 @@ var mcpSkySusdsDepositInputSchema = mcpMultisignInput({
611
811
  var mcpSkySusdsRedeemInputSchema = mcpMultisignInput({
612
812
  sharesHuman: zod.z.string().min(1)
613
813
  });
814
+ var mcpAaveV4MarketIdSchema = zod.z.string().min(1).optional().describe("UI market segment: main (Plus), core, or bluechip (Prime). Default main.");
815
+ var mcpAaveV4HealthPreviewSchema = {
816
+ skipHealthPreview: zod.z.boolean().optional().describe("Skip Aave v4 health-factor preview before withdraw/borrow/repay (not recommended)."),
817
+ acknowledgeHealthRisk: zod.z.boolean().optional().describe(
818
+ "Required true when preview returns a confirm-level health risk (withdraw/borrow/repay)."
819
+ )
820
+ };
614
821
  var mcpAaveV4DepositInputSchema = mcpMultisignInput({
615
- spoke: evmAddressSchema,
616
- underlying: evmAddressSchema,
822
+ spoke: evmAddressSchema.optional().describe("Omit \u2014 continuum-mcp-server resolves spoke from Aave v4 API."),
823
+ underlying: evmAddressSchema.describe(
824
+ "Asset to supply. Native ETH: 0x0 or wrapped native with isNativeIn true."
825
+ ),
617
826
  amountHuman: zod.z.string().min(1),
618
- marketId: zod.z.string().min(1)
827
+ marketId: mcpAaveV4MarketIdSchema,
828
+ isNativeIn: zod.z.boolean().optional().describe("Wrap native to wrapped native before supply (e.g. ETH \u2192 WETH)."),
829
+ enableAsCollateralAfterSupply: zod.z.boolean().optional().describe("Append setUsingAsCollateral after supply in the same batch.")
619
830
  });
620
831
  var mcpAaveV4WithdrawInputSchema = mcpMultisignInput({
621
- spoke: evmAddressSchema,
622
- underlying: evmAddressSchema,
832
+ spoke: evmAddressSchema.optional().describe("Omit \u2014 server resolves from Aave v4 API."),
833
+ underlying: evmAddressSchema.describe("Supplied asset to withdraw."),
623
834
  amountHuman: zod.z.string().min(1),
624
- marketId: zod.z.string().min(1)
835
+ marketId: mcpAaveV4MarketIdSchema,
836
+ ...mcpAaveV4HealthPreviewSchema
625
837
  });
626
838
  var mcpAaveV4BorrowInputSchema = mcpMultisignInput({
627
- spoke: evmAddressSchema,
628
- underlying: evmAddressSchema,
839
+ spoke: evmAddressSchema.optional().describe("Omit \u2014 server resolves from Aave v4 API."),
840
+ underlying: evmAddressSchema.describe("Debt asset to borrow (e.g. USDC), not collateral."),
629
841
  amountHuman: zod.z.string().min(1),
630
- marketId: zod.z.string().min(1)
842
+ marketId: mcpAaveV4MarketIdSchema,
843
+ collateralUnderlying: evmAddressSchema.optional().describe("Collateral token already supplied; helps pick hub when debt exists on multiple hubs."),
844
+ ...mcpAaveV4HealthPreviewSchema
631
845
  });
632
846
  var mcpAaveV4RepayInputSchema = mcpMultisignInput({
633
- spoke: evmAddressSchema,
634
- underlying: evmAddressSchema,
847
+ spoke: evmAddressSchema.optional().describe("Omit \u2014 server resolves from Aave v4 API."),
848
+ underlying: evmAddressSchema.describe("Debt token to repay."),
635
849
  amountHuman: zod.z.string().min(1),
636
- marketId: zod.z.string().min(1)
850
+ marketId: mcpAaveV4MarketIdSchema,
851
+ ...mcpAaveV4HealthPreviewSchema
637
852
  });
638
853
  var mcpEulerV2IsolatedLendInputSchema = mcpMultisignInput({
639
854
  vault: evmAddressSchema,
@@ -880,8 +1095,8 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
880
1095
  actionId: "aave-v4.deposit",
881
1096
  protocolId: "aave-v4",
882
1097
  chainCategory: "evm",
883
- description: "Build Aave v4 Spoke supply/deposit batch.",
884
- prerequisites: ["keyGen", "executorAddress", "spoke + underlying"],
1098
+ description: "Build Aave v4 Spoke supply/deposit batch (wrap native, approve, supply).",
1099
+ prerequisites: ["keyGenId", "chainId", "underlying", "amountHuman", "get_defi_protocol_skill for hubs/spokes"],
885
1100
  followUp: ["Sign messageToSign", "POST /multiSignRequest"],
886
1101
  handler: { importPath: "protocols/evm/aave-v4", exportName: "buildEvmMultisignBodyAaveV4DepositBatch" },
887
1102
  inputZod: mcpAaveV4DepositInputSchema
@@ -891,8 +1106,8 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
891
1106
  actionId: "aave-v4.withdraw",
892
1107
  protocolId: "aave-v4",
893
1108
  chainCategory: "evm",
894
- description: "Build Aave v4 Spoke withdraw batch.",
895
- prerequisites: ["keyGen", "executorAddress", "spoke + underlying"],
1109
+ description: "Build Aave v4 Spoke withdraw; health-factor preview when user has borrow debt.",
1110
+ prerequisites: ["keyGenId", "chainId", "underlying (supplied asset)", "amountHuman"],
896
1111
  followUp: ["Sign messageToSign", "POST /multiSignRequest"],
897
1112
  handler: { importPath: "protocols/evm/aave-v4", exportName: "buildEvmMultisignBodyAaveV4SpokeWithdraw" },
898
1113
  inputZod: mcpAaveV4WithdrawInputSchema
@@ -902,8 +1117,14 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
902
1117
  actionId: "aave-v4.borrow",
903
1118
  protocolId: "aave-v4",
904
1119
  chainCategory: "evm",
905
- description: "Build Aave v4 Spoke borrow batch.",
906
- prerequisites: ["keyGen", "executorAddress", "spoke + underlying"],
1120
+ description: "Build Aave v4 Spoke borrow; underlying is debt asset; collateral must be supplied first.",
1121
+ prerequisites: [
1122
+ "keyGenId",
1123
+ "chainId",
1124
+ "underlying (debt token)",
1125
+ "amountHuman",
1126
+ "collateral supplied via deposit"
1127
+ ],
907
1128
  followUp: ["Sign messageToSign", "POST /multiSignRequest"],
908
1129
  handler: { importPath: "protocols/evm/aave-v4", exportName: "buildEvmMultisignBodyAaveV4SpokeBorrow" },
909
1130
  inputZod: mcpAaveV4BorrowInputSchema
@@ -913,8 +1134,8 @@ var MCP_PROTOCOL_TOOL_DEFINITIONS = [
913
1134
  actionId: "aave-v4.repay",
914
1135
  protocolId: "aave-v4",
915
1136
  chainCategory: "evm",
916
- description: "Build Aave v4 Spoke repay batch.",
917
- prerequisites: ["keyGen", "executorAddress", "spoke + underlying"],
1137
+ description: "Build Aave v4 Spoke repay (approve if needed + repay).",
1138
+ prerequisites: ["keyGenId", "chainId", "underlying (debt token)", "amountHuman"],
918
1139
  followUp: ["Sign messageToSign", "POST /multiSignRequest"],
919
1140
  handler: { importPath: "protocols/evm/aave-v4", exportName: "buildEvmMultisignBodyAaveV4SpokeRepay" },
920
1141
  inputZod: mcpAaveV4RepayInputSchema
@@ -1004,7 +1225,11 @@ var CORE_MCP_TOOL_DEFINITIONS = [
1004
1225
  protocolId: "uniswap-v4",
1005
1226
  chainCategory: "evm",
1006
1227
  description: "Fetch a Uniswap V4 Trade API quote (POST /v1/quote). Returns classic quote JSON including quote.input/output amounts and routing. Does NOT create a sign request \u2014 use ctm_uniswap_v4_create_swap and ctm_uniswap_v4_build_swap_multisign after quoting. Requires uniswapApiKey and swapper (MPC executor address) or keyGen + managementNodeUrl to resolve swapper.",
1007
- prerequisites: ["Chain must be supported by Uniswap V4 (Universal Router map)."],
1228
+ prerequisites: [
1229
+ "UNISWAP_API_KEY in node Variables",
1230
+ "get_defi_protocol_skill for full quote \u2192 create_swap \u2192 build flow",
1231
+ "keyGenId (resolves swapper)"
1232
+ ],
1008
1233
  followUp: ["ctm_uniswap_v4_create_swap", "ctm_uniswap_v4_build_swap_multisign"],
1009
1234
  handler: { importPath: "protocols/evm/uniswap-v4", exportName: "uniswapTradeQuote" },
1010
1235
  inputZod: mcpUniswapV4QuoteInputSchema,
@@ -1016,7 +1241,10 @@ var CORE_MCP_TOOL_DEFINITIONS = [
1016
1241
  protocolId: "uniswap-v4",
1017
1242
  chainCategory: "evm",
1018
1243
  description: "Call Uniswap Trade API POST /v1/swap to build Universal Router calldata from a prior quote. Returns { swap: { to, data, value, gasLimit? }, requestId? }. Does NOT produce a multiSignRequest \u2014 call ctm_uniswap_v4_build_swap_multisign next.",
1019
- prerequisites: ["ctm_uniswap_v4_quote output (fullQuoteFromPermit)"],
1244
+ prerequisites: [
1245
+ "ctm_uniswap_v4_quote output (fullQuoteFromPermit)",
1246
+ "get_defi_protocol_skill for deadline and field alignment"
1247
+ ],
1020
1248
  followUp: ["ctm_uniswap_v4_build_swap_multisign"],
1021
1249
  handler: { importPath: "protocols/evm/uniswap-v4", exportName: "uniswapCreateSwap" },
1022
1250
  inputZod: mcpUniswapV4CreateSwapInputSchema,
@@ -1029,16 +1257,187 @@ var CORE_MCP_TOOL_DEFINITIONS = [
1029
1257
  chainCategory: "evm",
1030
1258
  description: "Build mpc-auth multiSignRequest body for a Uniswap V4 swap. May batch 1\u20133 EVM txs: ERC-20 approve(s) to Permit2/router path + Universal Router swap (or 1 tx for native-in). Estimates gas, serializes unsigned txs, sets proposalTxParams. Output must be signed and POSTed to /multiSignRequest by the caller.",
1031
1259
  prerequisites: [
1032
- "ctm_uniswap_v4_create_swap output",
1033
- "keyGen with pubkeyhex",
1034
- "executorAddress matching MPC wallet",
1035
- "RPC URL and chainDetail from node chain config"
1260
+ "ctm_uniswap_v4_create_swap output + matching quote snapshot and swapDeadlineUnix",
1261
+ "keyGenId + chainId + purposeText"
1036
1262
  ],
1037
1263
  followUp: ["Sign messageToSign", "POST /multiSignRequest with clientSig and signedMessage"],
1038
1264
  handler: { importPath: "protocols/evm/uniswap-v4", exportName: "buildEvmMultisignBodyUniswapV4SkipPermit2Batch" },
1039
1265
  inputZod: mcpUniswapV4BuildSwapMultisignInputSchema,
1040
1266
  outputZod: multisignOutputSchema
1041
1267
  }),
1268
+ defineMcpTool({
1269
+ name: "ctm_uniswap_v4_list_lp_pools",
1270
+ actionId: "uniswap-v4.lp-list-pools",
1271
+ protocolId: "uniswap-v4",
1272
+ chainCategory: "evm",
1273
+ description: "List standard Uniswap V4 LP pools for a chain (ETH/USDC and other main pairs at common fee tiers). Returns presetId, token addresses, fee, tickSpacing, and computed poolReference (bytes32 pool id). Use presetId as poolPreset on lp_create_position.",
1274
+ prerequisites: ["chainId"],
1275
+ followUp: ["ctm_uniswap_v4_lp_create_position"],
1276
+ handler: { importPath: "protocols/evm/uniswap-v4", exportName: "uniswapV4ListStandardLpPools" },
1277
+ inputZod: mcpUniswapV4LpListPoolsInputSchema,
1278
+ outputZod: mcpUniswapV4LpListPoolsOutputSchema
1279
+ }),
1280
+ defineMcpTool({
1281
+ name: "ctm_uniswap_v4_lp_create_position",
1282
+ actionId: "uniswap-v4.lp-create",
1283
+ protocolId: "uniswap-v4",
1284
+ chainCategory: "evm",
1285
+ description: "Call Uniswap LP API POST /lp/create for a new V4 position. Returns token amounts and `create` transaction calldata. Does NOT create a sign request \u2014 call ctm_uniswap_v4_build_mint_liquidity_multisign next. Pass poolPreset from list_lp_pools, or existingPool with poolReference (or fee+tickSpacing to derive pool id).",
1286
+ prerequisites: [
1287
+ "UNISWAP_API_KEY",
1288
+ "ctm_uniswap_v4_list_lp_pools for standard pairs",
1289
+ "get_defi_protocol_skill for LP flow"
1290
+ ],
1291
+ followUp: ["ctm_uniswap_v4_build_mint_liquidity_multisign"],
1292
+ handler: { importPath: "protocols/evm/uniswap-v4", exportName: "uniswapLpCreatePosition" },
1293
+ inputZod: mcpUniswapV4LpCreatePositionInputSchema,
1294
+ outputZod: mcpUniswapV4LpCreatePositionOutputSchema
1295
+ }),
1296
+ defineMcpTool({
1297
+ name: "ctm_uniswap_v4_build_mint_liquidity_multisign",
1298
+ actionId: "uniswap-v4.mint-liquidity",
1299
+ protocolId: "uniswap-v4",
1300
+ chainCategory: "evm",
1301
+ description: "Build mpc-auth multiSignRequest for minting a Uniswap V4 LP position. Batches ERC-20 approve(s) + Position Manager tx from LP create response.",
1302
+ prerequisites: ["ctm_uniswap_v4_lp_create_position output", "keyGenId + chainId + purposeText"],
1303
+ followUp: [
1304
+ "Sign messageToSign",
1305
+ "POST /multiSignRequest",
1306
+ "After execute: ctm_uniswap_v4_register_position_from_mint_tx (mint tx hash)"
1307
+ ],
1308
+ handler: {
1309
+ importPath: "protocols/evm/uniswap-v4",
1310
+ exportName: "buildEvmMultisignBodyUniswapV4MintLiquidityBatch"
1311
+ },
1312
+ inputZod: mcpUniswapV4BuildMintLiquidityMultisignInputSchema,
1313
+ outputZod: multisignOutputSchema
1314
+ }),
1315
+ defineMcpTool({
1316
+ name: "ctm_uniswap_v4_lp_increase",
1317
+ actionId: "uniswap-v4.lp-increase",
1318
+ protocolId: "uniswap-v4",
1319
+ chainCategory: "evm",
1320
+ description: "Call Uniswap LP API POST /lp/increase. Returns `increase` transaction calldata.",
1321
+ prerequisites: ["UNISWAP_API_KEY", "nftTokenId from ctm_uniswap_v4_lp_list_positions"],
1322
+ followUp: ["ctm_uniswap_v4_build_increase_liquidity_multisign"],
1323
+ handler: { importPath: "protocols/evm/uniswap-v4", exportName: "uniswapLpIncreasePosition" },
1324
+ inputZod: mcpUniswapV4LpIncreaseInputSchema,
1325
+ outputZod: mcpUniswapV4LpIncreaseOutputSchema
1326
+ }),
1327
+ defineMcpTool({
1328
+ name: "ctm_uniswap_v4_build_increase_liquidity_multisign",
1329
+ actionId: "uniswap-v4.increase-liquidity",
1330
+ protocolId: "uniswap-v4",
1331
+ chainCategory: "evm",
1332
+ description: "Build mpc-auth multiSignRequest to increase Uniswap V4 position liquidity.",
1333
+ prerequisites: ["ctm_uniswap_v4_lp_increase output"],
1334
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
1335
+ handler: {
1336
+ importPath: "protocols/evm/uniswap-v4",
1337
+ exportName: "buildEvmMultisignBodyUniswapV4IncreaseLiquidityBatch"
1338
+ },
1339
+ inputZod: mcpUniswapV4BuildIncreaseLiquidityMultisignInputSchema,
1340
+ outputZod: multisignOutputSchema
1341
+ }),
1342
+ defineMcpTool({
1343
+ name: "ctm_uniswap_v4_lp_decrease",
1344
+ actionId: "uniswap-v4.lp-decrease",
1345
+ protocolId: "uniswap-v4",
1346
+ chainCategory: "evm",
1347
+ description: "Call Uniswap LP API POST /lp/decrease. Returns `decrease` transaction calldata.",
1348
+ prerequisites: ["UNISWAP_API_KEY", "nftTokenId"],
1349
+ followUp: ["ctm_uniswap_v4_build_decrease_liquidity_multisign"],
1350
+ handler: { importPath: "protocols/evm/uniswap-v4", exportName: "uniswapLpDecreasePosition" },
1351
+ inputZod: mcpUniswapV4LpDecreaseInputSchema,
1352
+ outputZod: mcpUniswapV4LpDecreaseOutputSchema
1353
+ }),
1354
+ defineMcpTool({
1355
+ name: "ctm_uniswap_v4_build_decrease_liquidity_multisign",
1356
+ actionId: "uniswap-v4.decrease-liquidity",
1357
+ protocolId: "uniswap-v4",
1358
+ chainCategory: "evm",
1359
+ description: "Build mpc-auth multiSignRequest to decrease Uniswap V4 position liquidity.",
1360
+ prerequisites: ["ctm_uniswap_v4_lp_decrease output"],
1361
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
1362
+ handler: {
1363
+ importPath: "protocols/evm/uniswap-v4",
1364
+ exportName: "buildEvmMultisignBodyUniswapV4DecreaseLiquidityBatch"
1365
+ },
1366
+ inputZod: mcpUniswapV4BuildDecreaseLiquidityMultisignInputSchema,
1367
+ outputZod: multisignOutputSchema
1368
+ }),
1369
+ defineMcpTool({
1370
+ name: "ctm_uniswap_v4_lp_collect",
1371
+ actionId: "uniswap-v4.lp-claim",
1372
+ protocolId: "uniswap-v4",
1373
+ chainCategory: "evm",
1374
+ description: "Call Uniswap LP API POST /lp/claim to collect accrued fees from a V4 position.",
1375
+ prerequisites: ["UNISWAP_API_KEY", "nftTokenId"],
1376
+ followUp: ["ctm_uniswap_v4_build_collect_fees_multisign"],
1377
+ handler: { importPath: "protocols/evm/uniswap-v4", exportName: "uniswapLpClaimFees" },
1378
+ inputZod: mcpUniswapV4LpClaimInputSchema,
1379
+ outputZod: mcpUniswapV4LpClaimOutputSchema
1380
+ }),
1381
+ defineMcpTool({
1382
+ name: "ctm_uniswap_v4_build_collect_fees_multisign",
1383
+ actionId: "uniswap-v4.collect-fees",
1384
+ protocolId: "uniswap-v4",
1385
+ chainCategory: "evm",
1386
+ description: "Build mpc-auth multiSignRequest to collect fees from a Uniswap V4 position.",
1387
+ prerequisites: ["ctm_uniswap_v4_lp_collect output"],
1388
+ followUp: ["Sign messageToSign", "POST /multiSignRequest"],
1389
+ handler: {
1390
+ importPath: "protocols/evm/uniswap-v4",
1391
+ exportName: "buildEvmMultisignBodyUniswapV4CollectFeesBatch"
1392
+ },
1393
+ inputZod: mcpUniswapV4BuildCollectFeesMultisignInputSchema,
1394
+ outputZod: multisignOutputSchema
1395
+ }),
1396
+ defineMcpTool({
1397
+ name: "ctm_uniswap_v4_lp_list_positions",
1398
+ actionId: "uniswap-v4.lp-list-positions",
1399
+ protocolId: "uniswap-v4",
1400
+ chainCategory: "evm",
1401
+ description: "List Uniswap V4 position NFTs from the node token registry (ERC721 entries for the Position Manager on this chain). Does not scan blockchain logs. Pass keyGenId + chainId.",
1402
+ prerequisites: ["keyGenId + chainId", "Positions saved via register_position_nft or add_to_token_registry"],
1403
+ followUp: ["ctm_uniswap_v4_lp_increase", "ctm_uniswap_v4_lp_decrease", "ctm_uniswap_v4_lp_collect"],
1404
+ handler: {
1405
+ importPath: "protocols/evm/uniswap-v4",
1406
+ exportName: "uniswapV4ListPositionsRegistryMcpPlaceholder"
1407
+ },
1408
+ inputZod: mcpUniswapV4LpListPositionsInputSchema,
1409
+ outputZod: mcpUniswapV4LpListPositionsOutputSchema
1410
+ }),
1411
+ defineMcpTool({
1412
+ name: "ctm_uniswap_v4_register_position_nft",
1413
+ actionId: "uniswap-v4.register-position-nft",
1414
+ protocolId: "uniswap-v4",
1415
+ chainCategory: "evm",
1416
+ description: "Add a Uniswap V4 position NFT to the node token registry (ERC721, management-signed). Call after mint execute when tokenId is known.",
1417
+ prerequisites: ["chainId", "tokenId", "keyGenId for management signing"],
1418
+ followUp: ["ctm_uniswap_v4_lp_list_positions", "ctm_uniswap_v4_lp_increase"],
1419
+ handler: {
1420
+ importPath: "protocols/evm/uniswap-v4",
1421
+ exportName: "uniswapV4RegisterPositionNftPlaceholder"
1422
+ },
1423
+ inputZod: mcpUniswapV4RegisterPositionNftInputSchema,
1424
+ outputZod: mcpUniswapV4RegisterPositionNftOutputSchema
1425
+ }),
1426
+ defineMcpTool({
1427
+ name: "ctm_uniswap_v4_register_position_from_mint_tx",
1428
+ actionId: "uniswap-v4.register-position-from-mint-tx",
1429
+ protocolId: "uniswap-v4",
1430
+ chainCategory: "evm",
1431
+ description: "Parse a completed mint transaction receipt for the new position tokenId and add it to the node token registry (management-signed).",
1432
+ prerequisites: ["chainId", "txHash from mint batch execute", "keyGenId"],
1433
+ followUp: ["ctm_uniswap_v4_lp_list_positions"],
1434
+ handler: {
1435
+ importPath: "protocols/evm/uniswap-v4",
1436
+ exportName: "uniswapV4RegisterPositionFromMintTxPlaceholder"
1437
+ },
1438
+ inputZod: mcpUniswapV4RegisterPositionFromMintTxInputSchema,
1439
+ outputZod: mcpUniswapV4RegisterPositionFromMintTxOutputSchema
1440
+ }),
1042
1441
  defineMcpTool({
1043
1442
  name: "ctm_curve_dao_quote",
1044
1443
  actionId: "curve-dao.quote",
@@ -1046,8 +1445,9 @@ var CORE_MCP_TOOL_DEFINITIONS = [
1046
1445
  chainCategory: "evm",
1047
1446
  description: "Fetch a Curve Router NG quote via @curvefi/api getBestRouteAndOutput. Returns output amount, route, and optional priceImpactPercent. Does NOT create a sign request \u2014 call ctm_curve_dao_build_swap_multisign after quoting. Pass chainId only; rpcUrl is resolved from get_chain_registry rpcGateway.",
1048
1447
  prerequisites: [
1049
- "Chain must be supported by Curve (@curvefi/api network constants).",
1050
- "Configure rpcGateway for chainId in get_chain_registry."
1448
+ "get_defi_protocol_skill for native placeholder vs wrapped native on build",
1449
+ "chainId + tokenIn + tokenOut + amountHuman",
1450
+ "rpcGateway in get_chain_registry"
1051
1451
  ],
1052
1452
  followUp: ["ctm_curve_dao_build_swap_multisign"],
1053
1453
  handler: { importPath: "protocols/evm/curve-dao", exportName: "curveDaoQuote" },
@@ -1061,9 +1461,9 @@ var CORE_MCP_TOOL_DEFINITIONS = [
1061
1461
  chainCategory: "evm",
1062
1462
  description: "Build 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. Requires JSON-RPC and Curve-supported chain.",
1063
1463
  prerequisites: [
1064
- "ctm_curve_dao_quote (recommended) or known-good route",
1065
- "keyGenId + chainId + purposeText",
1066
- "tokenIn/tokenOut/amountHuman/slippagePercent"
1464
+ "ctm_curve_dao_quote (recommended)",
1465
+ "keyGenId + chainId + purposeText + slippagePercent (0\u2013100 exclusive)",
1466
+ "get_defi_protocol_skill for tokenIn address rules"
1067
1467
  ],
1068
1468
  followUp: ["Sign messageToSign", "POST /multiSignRequest with clientSig and signedMessage"],
1069
1469
  handler: { importPath: "protocols/evm/curve-dao", exportName: "buildEvmMultisignBodyCurveDaoBatch" },
@@ -1819,11 +2219,31 @@ exports.mcpSkyLockstakeStakeInputSchema = mcpSkyLockstakeStakeInputSchema;
1819
2219
  exports.mcpSkyLockstakeWipeInputSchema = mcpSkyLockstakeWipeInputSchema;
1820
2220
  exports.mcpSkySusdsDepositInputSchema = mcpSkySusdsDepositInputSchema;
1821
2221
  exports.mcpSkySusdsRedeemInputSchema = mcpSkySusdsRedeemInputSchema;
2222
+ exports.mcpUniswapV4BuildCollectFeesMultisignInputSchema = mcpUniswapV4BuildCollectFeesMultisignInputSchema;
2223
+ exports.mcpUniswapV4BuildDecreaseLiquidityMultisignInputSchema = mcpUniswapV4BuildDecreaseLiquidityMultisignInputSchema;
2224
+ exports.mcpUniswapV4BuildIncreaseLiquidityMultisignInputSchema = mcpUniswapV4BuildIncreaseLiquidityMultisignInputSchema;
2225
+ exports.mcpUniswapV4BuildMintLiquidityMultisignInputSchema = mcpUniswapV4BuildMintLiquidityMultisignInputSchema;
1822
2226
  exports.mcpUniswapV4BuildSwapMultisignInputSchema = mcpUniswapV4BuildSwapMultisignInputSchema;
1823
2227
  exports.mcpUniswapV4CreateSwapInputSchema = mcpUniswapV4CreateSwapInputSchema;
1824
2228
  exports.mcpUniswapV4CreateSwapOutputSchema = mcpUniswapV4CreateSwapOutputSchema;
2229
+ exports.mcpUniswapV4LpClaimInputSchema = mcpUniswapV4LpClaimInputSchema;
2230
+ exports.mcpUniswapV4LpClaimOutputSchema = mcpUniswapV4LpClaimOutputSchema;
2231
+ exports.mcpUniswapV4LpCreatePositionInputSchema = mcpUniswapV4LpCreatePositionInputSchema;
2232
+ exports.mcpUniswapV4LpCreatePositionOutputSchema = mcpUniswapV4LpCreatePositionOutputSchema;
2233
+ exports.mcpUniswapV4LpDecreaseInputSchema = mcpUniswapV4LpDecreaseInputSchema;
2234
+ exports.mcpUniswapV4LpDecreaseOutputSchema = mcpUniswapV4LpDecreaseOutputSchema;
2235
+ exports.mcpUniswapV4LpIncreaseInputSchema = mcpUniswapV4LpIncreaseInputSchema;
2236
+ exports.mcpUniswapV4LpIncreaseOutputSchema = mcpUniswapV4LpIncreaseOutputSchema;
2237
+ exports.mcpUniswapV4LpListPoolsInputSchema = mcpUniswapV4LpListPoolsInputSchema;
2238
+ exports.mcpUniswapV4LpListPoolsOutputSchema = mcpUniswapV4LpListPoolsOutputSchema;
2239
+ exports.mcpUniswapV4LpListPositionsInputSchema = mcpUniswapV4LpListPositionsInputSchema;
2240
+ exports.mcpUniswapV4LpListPositionsOutputSchema = mcpUniswapV4LpListPositionsOutputSchema;
1825
2241
  exports.mcpUniswapV4QuoteInputSchema = mcpUniswapV4QuoteInputSchema;
1826
2242
  exports.mcpUniswapV4QuoteOutputSchema = mcpUniswapV4QuoteOutputSchema;
2243
+ exports.mcpUniswapV4RegisterPositionFromMintTxInputSchema = mcpUniswapV4RegisterPositionFromMintTxInputSchema;
2244
+ exports.mcpUniswapV4RegisterPositionFromMintTxOutputSchema = mcpUniswapV4RegisterPositionFromMintTxOutputSchema;
2245
+ exports.mcpUniswapV4RegisterPositionNftInputSchema = mcpUniswapV4RegisterPositionNftInputSchema;
2246
+ exports.mcpUniswapV4RegisterPositionNftOutputSchema = mcpUniswapV4RegisterPositionNftOutputSchema;
1827
2247
  exports.multisignOutputSchema = multisignOutputSchema;
1828
2248
  exports.parseMcpToolInput = parseMcpToolInput;
1829
2249
  exports.parseMcpToolOutput = parseMcpToolOutput;