@arcadia-finance/mcp-server 0.4.2 → 0.4.3

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.
@@ -14,7 +14,7 @@ export const BatchedTransactionOutput = z.object({
14
14
  description: z.string().optional(),
15
15
  transaction: Transaction,
16
16
  tenderly_sim_url: z.string().optional(),
17
- tenderly_sim_status: z.enum(["true", "false", "unavailable"]).optional(),
17
+ tenderly_sim_status: z.enum(["success", "failure", "unavailable"]).optional(),
18
18
  expected_value_change: z.string().optional(),
19
19
  before: z
20
20
  .object({ total_account_value: z.string(), used_margin: z.string() })
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  import { CHAIN_ID_DESCRIPTION } from "../../../config/chains.js";
3
3
  import { getPublicClient } from "../../../clients/chain.js";
4
4
  import { readAccountMetadata } from "./metadata.js";
5
- import { formatBatchedResponse } from "./format-response.js";
5
+ import { formatBatchedResponse, isSimulationFailed } from "./format-response.js";
6
6
  import { TOKENS } from "../../../config/addresses.js";
7
7
  import { validateAddress, validateChainId } from "../../../utils/validation.js";
8
8
  import { BatchedTransactionOutput } from "../../output-schemas.js";
@@ -299,7 +299,7 @@ export function registerAddLiquidityTool(server, api, chains) {
299
299
  const result = await api.getBundleCalldata(body);
300
300
  const res = result;
301
301
  // Surface simulation failure — do NOT return calldata
302
- if (res.tenderly_sim_status === "false") {
302
+ if (isSimulationFailed(res.tenderly_sim_status)) {
303
303
  const simUrl = res.tenderly_sim_url
304
304
  ? `\nTenderly simulation: ${res.tenderly_sim_url}`
305
305
  : "";
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  import { CHAIN_ID_DESCRIPTION } from "../../../config/chains.js";
3
3
  import { getPublicClient } from "../../../clients/chain.js";
4
4
  import { readAccountMetadata } from "./metadata.js";
5
- import { formatBatchedResponse } from "./format-response.js";
5
+ import { formatBatchedResponse, isSimulationFailed } from "./format-response.js";
6
6
  import { validateAddress, validateChainId } from "../../../utils/validation.js";
7
7
  import { BatchedTransactionOutput } from "../../output-schemas.js";
8
8
  export function registerCloseTool(server, api, chains) {
@@ -179,7 +179,7 @@ The returned calldata is time-sensitive — sign and broadcast within 30 seconds
179
179
  };
180
180
  const result = await api.getBundleCalldata(body);
181
181
  const res = result;
182
- if (res.tenderly_sim_status === "false") {
182
+ if (isSimulationFailed(res.tenderly_sim_status)) {
183
183
  const simUrl = res.tenderly_sim_url
184
184
  ? `\nTenderly simulation: ${res.tenderly_sim_url}`
185
185
  : "";
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { CHAIN_ID_DESCRIPTION } from "../../../config/chains.js";
3
- import { formatBatchedResponse } from "./format-response.js";
3
+ import { formatBatchedResponse, isSimulationFailed } from "./format-response.js";
4
4
  import { validateAddress } from "../../../utils/validation.js";
5
5
  import { BatchedTransactionOutput } from "../../output-schemas.js";
6
6
  export function registerDeleverageTool(server, api) {
@@ -39,7 +39,7 @@ export function registerDeleverageTool(server, api) {
39
39
  slippage: slippage ?? 100,
40
40
  });
41
41
  const res = result;
42
- if (res.tenderly_sim_status === "false") {
42
+ if (isSimulationFailed(res.tenderly_sim_status)) {
43
43
  const simUrl = res.tenderly_sim_url
44
44
  ? `\nTenderly simulation: ${res.tenderly_sim_url}`
45
45
  : "";
@@ -1,4 +1,17 @@
1
1
  import { appendDataSuffix } from "../../../utils/attribution.js";
2
+ // Backend emits `tenderly_sim_status` as a JSON boolean (Python bool). We normalize
3
+ // to a 3-state string enum for clearer tool output. Historically the TS types
4
+ // claimed `string`, so legacy "true"/"false" strings are also tolerated here.
5
+ export function isSimulationFailed(status) {
6
+ return status === false || status === "false";
7
+ }
8
+ function normalizeSimStatus(status) {
9
+ if (status === true || status === "true")
10
+ return "success";
11
+ if (status === false || status === "false")
12
+ return "failure";
13
+ return "unavailable";
14
+ }
2
15
  export function formatBatchedResponse(result, chainId, description) {
3
16
  const to = (result.fx_call_to ?? "");
4
17
  const data = appendDataSuffix((result.calldata ?? ""));
@@ -9,12 +22,7 @@ export function formatBatchedResponse(result, chainId, description) {
9
22
  if (result.tenderly_sim_url != null) {
10
23
  response.tenderly_sim_url = result.tenderly_sim_url;
11
24
  }
12
- if (result.tenderly_sim_status != null) {
13
- response.tenderly_sim_status = result.tenderly_sim_status;
14
- }
15
- else {
16
- response.tenderly_sim_status = "unavailable";
17
- }
25
+ response.tenderly_sim_status = normalizeSimStatus(result.tenderly_sim_status);
18
26
  if (result.expected_value_change != null) {
19
27
  response.expected_value_change = String(result.expected_value_change);
20
28
  }
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { CHAIN_ID_DESCRIPTION } from "../../../config/chains.js";
3
- import { formatBatchedResponse } from "./format-response.js";
3
+ import { formatBatchedResponse, isSimulationFailed } from "./format-response.js";
4
4
  import { validateAddress } from "../../../utils/validation.js";
5
5
  import { BatchedTransactionOutput } from "../../output-schemas.js";
6
6
  export function registerRemoveLiquidityTool(server, api) {
@@ -39,7 +39,7 @@ The returned calldata is time-sensitive — sign and broadcast within 30 seconds
39
39
  adjustment,
40
40
  });
41
41
  const res = result;
42
- if (res.tenderly_sim_status === "false") {
42
+ if (isSimulationFailed(res.tenderly_sim_status)) {
43
43
  const simUrl = res.tenderly_sim_url
44
44
  ? `\nTenderly simulation: ${res.tenderly_sim_url}`
45
45
  : "";
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { CHAIN_ID_DESCRIPTION } from "../../../config/chains.js";
3
- import { formatBatchedResponse } from "./format-response.js";
3
+ import { formatBatchedResponse, isSimulationFailed } from "./format-response.js";
4
4
  import { validateAddress } from "../../../utils/validation.js";
5
5
  import { BatchedTransactionOutput } from "../../output-schemas.js";
6
6
  export function registerStakeTool(server, api) {
@@ -33,7 +33,7 @@ export function registerStakeTool(server, api) {
33
33
  asset_id,
34
34
  });
35
35
  const claimRes = result;
36
- if (claimRes.tenderly_sim_status === "false") {
36
+ if (isSimulationFailed(claimRes.tenderly_sim_status)) {
37
37
  const simUrl = claimRes.tenderly_sim_url
38
38
  ? `\nTenderly simulation: ${claimRes.tenderly_sim_url}`
39
39
  : "";
@@ -68,7 +68,7 @@ export function registerStakeTool(server, api) {
68
68
  asset_id,
69
69
  });
70
70
  const res = result;
71
- if (res.tenderly_sim_status === "false") {
71
+ if (isSimulationFailed(res.tenderly_sim_status)) {
72
72
  const simUrl = res.tenderly_sim_url
73
73
  ? `\nTenderly simulation: ${res.tenderly_sim_url}`
74
74
  : "";
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { CHAIN_ID_DESCRIPTION } from "../../../config/chains.js";
3
- import { formatBatchedResponse } from "./format-response.js";
3
+ import { formatBatchedResponse, isSimulationFailed } from "./format-response.js";
4
4
  import { validateAddress } from "../../../utils/validation.js";
5
5
  import { BatchedTransactionOutput } from "../../output-schemas.js";
6
6
  export function registerSwapTool(server, api) {
@@ -36,7 +36,7 @@ export function registerSwapTool(server, api) {
36
36
  slippage: slippage ?? 100,
37
37
  });
38
38
  const res = result;
39
- if (res.tenderly_sim_status === "false") {
39
+ if (isSimulationFailed(res.tenderly_sim_status)) {
40
40
  const simUrl = res.tenderly_sim_url
41
41
  ? `\nTenderly simulation: ${res.tenderly_sim_url}`
42
42
  : "";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arcadia-finance/mcp-server",
3
3
  "mcpName": "io.github.arcadia-finance/mcp-server",
4
- "version": "0.4.2",
4
+ "version": "0.4.3",
5
5
  "description": "MCP server for Arcadia Finance. Deploy concentrated liquidity on Uniswap, Aerodrome, and Velodrome with automated rebalancing, compounding, yield optimization, and leverage, or single-sided liquidity into lending pools. Base, Unichain, and Optimism.",
6
6
  "type": "module",
7
7
  "license": "AGPL-3.0",
package/server.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "io.github.arcadia-finance/mcp-server",
4
4
  "title": "Arcadia Finance",
5
5
  "description": "Concentrated liquidity on Uniswap/Aerodrome (rebalance, compound, leverage) or single-sided lending.",
6
- "version": "0.4.2",
6
+ "version": "0.4.3",
7
7
  "websiteUrl": "https://arcadia.finance",
8
8
  "repository": {
9
9
  "url": "https://github.com/arcadia-finance/mcp-server",
@@ -13,7 +13,7 @@
13
13
  {
14
14
  "registryType": "npm",
15
15
  "identifier": "@arcadia-finance/mcp-server",
16
- "version": "0.4.2",
16
+ "version": "0.4.3",
17
17
  "transport": {
18
18
  "type": "stdio"
19
19
  },