@0xinsider/mcp 2.1.0 → 2.4.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/README.md +49 -17
- package/dist/catalog.generated.d.ts +42 -6
- package/dist/catalog.generated.d.ts.map +1 -1
- package/dist/catalog.generated.js +51 -6
- package/dist/catalog.generated.js.map +1 -1
- package/dist/cli-lib.d.ts +8 -0
- package/dist/cli-lib.d.ts.map +1 -1
- package/dist/cli-lib.js +123 -17
- package/dist/cli-lib.js.map +1 -1
- package/dist/client.d.ts +35 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +42 -4
- package/dist/client.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/product-cli/client.d.ts +3 -2
- package/dist/product-cli/client.d.ts.map +1 -1
- package/dist/product-cli/client.js.map +1 -1
- package/dist/product-cli/index.d.ts.map +1 -1
- package/dist/product-cli/index.js +3 -1
- package/dist/product-cli/index.js.map +1 -1
- package/dist/prompts/index.js +2 -2
- package/dist/sdk/client.d.ts +861 -136
- package/dist/sdk/client.d.ts.map +1 -1
- package/dist/sdk/client.js +924 -127
- package/dist/sdk/client.js.map +1 -1
- package/dist/sdk/errors.d.ts +48 -4
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +123 -3
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.d.ts +40 -9
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +6 -4
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/pagination.d.ts +133 -15
- package/dist/sdk/pagination.d.ts.map +1 -1
- package/dist/sdk/pagination.js +132 -34
- package/dist/sdk/pagination.js.map +1 -1
- package/dist/sdk/retry.d.ts +68 -0
- package/dist/sdk/retry.d.ts.map +1 -0
- package/dist/sdk/retry.js +125 -0
- package/dist/sdk/retry.js.map +1 -0
- package/dist/sdk/schema.d.ts +2200 -688
- package/dist/sdk/schema.d.ts.map +1 -1
- package/dist/sdk/stream.d.ts +323 -8
- package/dist/sdk/stream.d.ts.map +1 -1
- package/dist/sdk/stream.js +582 -56
- package/dist/sdk/stream.js.map +1 -1
- package/dist/sdk/webhooks.d.ts +104 -12
- package/dist/sdk/webhooks.d.ts.map +1 -1
- package/dist/sdk/webhooks.js +22 -4
- package/dist/sdk/webhooks.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +13 -2
- package/dist/server.js.map +1 -1
- package/dist/tools/explore-markets.d.ts.map +1 -1
- package/dist/tools/explore-markets.js +2 -5
- package/dist/tools/explore-markets.js.map +1 -1
- package/dist/tools/games.d.ts +5 -0
- package/dist/tools/games.d.ts.map +1 -0
- package/dist/tools/games.js +103 -0
- package/dist/tools/games.js.map +1 -0
- package/dist/tools/get-insider-radar.d.ts.map +1 -1
- package/dist/tools/get-insider-radar.js +11 -40
- package/dist/tools/get-insider-radar.js.map +1 -1
- package/dist/tools/get-large-positions.d.ts.map +1 -1
- package/dist/tools/get-large-positions.js +3 -10
- package/dist/tools/get-large-positions.js.map +1 -1
- package/dist/tools/get-leaderboard.d.ts.map +1 -1
- package/dist/tools/get-leaderboard.js +23 -12
- package/dist/tools/get-leaderboard.js.map +1 -1
- package/dist/tools/get-market-intel.d.ts.map +1 -1
- package/dist/tools/get-market-intel.js +3 -6
- package/dist/tools/get-market-intel.js.map +1 -1
- package/dist/tools/get-position-timeline.d.ts.map +1 -1
- package/dist/tools/get-position-timeline.js +3 -10
- package/dist/tools/get-position-timeline.js.map +1 -1
- package/dist/tools/get-positions.d.ts +2 -0
- package/dist/tools/get-positions.d.ts.map +1 -1
- package/dist/tools/get-positions.js +8 -11
- package/dist/tools/get-positions.js.map +1 -1
- package/dist/tools/get-suspicious-trades.d.ts +26 -0
- package/dist/tools/get-suspicious-trades.d.ts.map +1 -0
- package/dist/tools/get-suspicious-trades.js +91 -0
- package/dist/tools/get-suspicious-trades.js.map +1 -0
- package/dist/tools/get-trader-pnl.d.ts.map +1 -1
- package/dist/tools/get-trader-pnl.js +3 -6
- package/dist/tools/get-trader-pnl.js.map +1 -1
- package/dist/tools/get-trader.d.ts.map +1 -1
- package/dist/tools/get-trader.js +3 -6
- package/dist/tools/get-trader.js.map +1 -1
- package/dist/tools/get-trending-wallets.d.ts.map +1 -1
- package/dist/tools/get-trending-wallets.js +3 -10
- package/dist/tools/get-trending-wallets.js.map +1 -1
- package/dist/tools/get-whale-trades.d.ts +2 -0
- package/dist/tools/get-whale-trades.d.ts.map +1 -1
- package/dist/tools/get-whale-trades.js +21 -16
- package/dist/tools/get-whale-trades.js.map +1 -1
- package/dist/tools/pick-of-the-day.d.ts.map +1 -1
- package/dist/tools/pick-of-the-day.js +5 -21
- package/dist/tools/pick-of-the-day.js.map +1 -1
- package/dist/tools/read-parity.d.ts +8 -0
- package/dist/tools/read-parity.d.ts.map +1 -1
- package/dist/tools/read-parity.js +125 -77
- package/dist/tools/read-parity.js.map +1 -1
- package/dist/tools/result.d.ts +31 -0
- package/dist/tools/result.d.ts.map +1 -0
- package/dist/tools/result.js +70 -0
- package/dist/tools/result.js.map +1 -0
- package/dist/tools/search-markets.d.ts.map +1 -1
- package/dist/tools/search-markets.js +16 -11
- package/dist/tools/search-markets.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,61 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// Deprecated alias of get_suspicious_trades (#16301). It keeps calling the
|
|
2
|
+
// deprecated /api/v1/insider-radar path and shares the canonical tool's schema
|
|
3
|
+
// and wording, so an existing client keeps working unchanged.
|
|
4
|
+
import { fail, listResult, ok } from "./result.js";
|
|
5
|
+
import { SUSPICIOUS_TRADES_DESCRIPTION, suspiciousTradesInputSchema, } from "./get-suspicious-trades.js";
|
|
3
6
|
export function registerGetInsiderRadar(server, client) {
|
|
4
7
|
server.registerTool("get_insider_radar", {
|
|
5
8
|
title: "Get Insider Radar Flags",
|
|
6
|
-
description: `
|
|
7
|
-
|
|
8
|
-
Each flag includes:
|
|
9
|
-
- suspicion_score (0-100)
|
|
10
|
-
- severity (flag or watch)
|
|
11
|
-
- Sub-scores: timing, edge, size, fresh_wallet
|
|
12
|
-
- Evidence JSON with details
|
|
13
|
-
|
|
14
|
-
Args:
|
|
15
|
-
- limit (number, 1-100, default 20): Max results per page
|
|
16
|
-
- cursor (string, optional): Pagination cursor from previous response
|
|
17
|
-
- min_suspicion (number, 0-100, default 0): Minimum suspicion score
|
|
18
|
-
- severity (string, optional): Filter by severity: "flag" or "watch"
|
|
19
|
-
|
|
20
|
-
Returns: List of radar flags with trader, market, scores, and evidence.`,
|
|
21
|
-
inputSchema: {
|
|
22
|
-
limit: z.number().int().min(1).max(100).default(20)
|
|
23
|
-
.describe("Max results (1-100, default 20)"),
|
|
24
|
-
cursor: z.string().optional()
|
|
25
|
-
.describe("Pagination cursor from previous response"),
|
|
26
|
-
min_suspicion: z.number().min(0).max(100).default(0)
|
|
27
|
-
.describe("Minimum suspicion score (0-100)"),
|
|
28
|
-
severity: z.enum(["flag", "watch"]).optional()
|
|
29
|
-
.describe("Filter by severity level"),
|
|
30
|
-
},
|
|
9
|
+
description: `Deprecated alias of get_suspicious_trades (#16301), kept live; it calls the deprecated /api/v1/insider-radar path. ${SUSPICIOUS_TRADES_DESCRIPTION}`,
|
|
10
|
+
inputSchema: suspiciousTradesInputSchema,
|
|
31
11
|
annotations: {
|
|
32
12
|
readOnlyHint: true,
|
|
33
13
|
destructiveHint: false,
|
|
34
14
|
idempotentHint: true,
|
|
35
15
|
openWorldHint: false,
|
|
36
16
|
},
|
|
37
|
-
}, async ({ limit, cursor, min_suspicion, severity }) => {
|
|
17
|
+
}, async ({ limit, cursor, min_suspicion, severity, mode }) => {
|
|
38
18
|
try {
|
|
39
19
|
const response = await client.request("/api/v1/insider-radar", {
|
|
40
20
|
limit,
|
|
41
21
|
cursor,
|
|
42
22
|
min_suspicion,
|
|
43
23
|
severity,
|
|
24
|
+
mode,
|
|
44
25
|
});
|
|
45
|
-
|
|
46
|
-
data: response.data,
|
|
47
|
-
has_more: response.has_more,
|
|
48
|
-
next_cursor: response.next_cursor,
|
|
49
|
-
};
|
|
50
|
-
return {
|
|
51
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
52
|
-
};
|
|
26
|
+
return ok(listResult(response));
|
|
53
27
|
}
|
|
54
28
|
catch (error) {
|
|
55
|
-
return
|
|
56
|
-
isError: true,
|
|
57
|
-
content: [{ type: "text", text: error instanceof ApiError ? error.message : `Unexpected error: ${error}` }],
|
|
58
|
-
};
|
|
29
|
+
return fail(error);
|
|
59
30
|
}
|
|
60
31
|
});
|
|
61
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-insider-radar.js","sourceRoot":"","sources":["../../src/tools/get-insider-radar.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-insider-radar.js","sourceRoot":"","sources":["../../src/tools/get-insider-radar.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,+EAA+E;AAC/E,8DAA8D;AAI9D,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AAEpC,MAAM,UAAU,uBAAuB,CAAC,MAAiB,EAAE,MAAiB;IAC1E,MAAM,CAAC,YAAY,CACjB,mBAAmB,EACnB;QACE,KAAK,EAAE,yBAAyB;QAChC,WAAW,EAAE,sHAAsH,6BAA6B,EAAE;QAClK,WAAW,EAAE,2BAA2B;QACxC,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,KAAK;SACrB;KACF,EACD,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE;QACzD,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,uBAAuB,EAAE;gBAC7D,KAAK;gBACL,MAAM;gBACN,aAAa;gBACb,QAAQ;gBACR,IAAI;aACL,CAAC,CAAC;YACH,OAAO,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-large-positions.d.ts","sourceRoot":"","sources":["../../src/tools/get-large-positions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"get-large-positions.d.ts","sourceRoot":"","sources":["../../src/tools/get-large-positions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,eAAO,MAAM,0BAA0B;IACrC,KAAK;IAEL,MAAM;IAEN,QAAQ;IAER,QAAQ;IAER,SAAS;;;;;;;;IAET,YAAY;CAEb,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAS9C;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CAyCpF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { fail, listResult } from "./result.js";
|
|
3
3
|
export const largePositionsParamsSchema = {
|
|
4
4
|
limit: z.number().int().min(1).max(100).default(20)
|
|
5
5
|
.describe("Max results (1-100, default 20)"),
|
|
@@ -48,20 +48,13 @@ Returns: List of large positions with trader, market, value, P&L, and freshness
|
|
|
48
48
|
}, async (args) => {
|
|
49
49
|
try {
|
|
50
50
|
const response = await client.request("/api/v1/large-positions", buildLargePositionsParams(args));
|
|
51
|
-
const result =
|
|
52
|
-
data: response.data,
|
|
53
|
-
has_more: response.has_more,
|
|
54
|
-
next_cursor: response.next_cursor,
|
|
55
|
-
};
|
|
51
|
+
const result = listResult(response);
|
|
56
52
|
return {
|
|
57
53
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
58
54
|
};
|
|
59
55
|
}
|
|
60
56
|
catch (error) {
|
|
61
|
-
return
|
|
62
|
-
isError: true,
|
|
63
|
-
content: [{ type: "text", text: error instanceof ApiError ? error.message : `Unexpected error: ${error}` }],
|
|
64
|
-
};
|
|
57
|
+
return fail(error);
|
|
65
58
|
}
|
|
66
59
|
});
|
|
67
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-large-positions.js","sourceRoot":"","sources":["../../src/tools/get-large-positions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"get-large-positions.js","sourceRoot":"","sources":["../../src/tools/get-large-positions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM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AAiB,EAAE,MAAiB;IAC5E,MAAM,CAAC,YAAY,CACjB,qBAAqB,EACrB;QACE,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EAAE;;;;;;;;;;kHAU+F;QAC5G,WAAW,EAAE,0BAA0B;QACvC,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,KAAK;SACrB;KACF,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CACnC,yBAAyB,EACzB,yBAAyB,CAAC,IAAI,CAAC,CAChC,CAAC;YAEF,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;YAEpC,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aAC5E,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-leaderboard.d.ts","sourceRoot":"","sources":["../../src/tools/get-leaderboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"get-leaderboard.d.ts","sourceRoot":"","sources":["../../src/tools/get-leaderboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAsBzC,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CAkDjF"}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { fail, listResult } from "./result.js";
|
|
3
|
+
/**
|
|
4
|
+
* The strategies `GET /api/v1/leaderboard` accepts (`STRATEGY_ENUM` in
|
|
5
|
+
* `backend/src/api_v1/handlers/leaderboard.rs`, the spec's enum, and the SDK's
|
|
6
|
+
* `LEADERBOARD_STRATEGIES`). Any other value is a 400 at the route, so the
|
|
7
|
+
* schema refuses it first (#16548).
|
|
8
|
+
*/
|
|
9
|
+
const LEADERBOARD_STRATEGIES = [
|
|
10
|
+
"accumulator",
|
|
11
|
+
"algo_trader",
|
|
12
|
+
"arbitrageur",
|
|
13
|
+
"directional",
|
|
14
|
+
"event_driven",
|
|
15
|
+
"market_maker",
|
|
16
|
+
"momentum",
|
|
17
|
+
"scalper",
|
|
18
|
+
"speculator",
|
|
19
|
+
"swing_trader",
|
|
20
|
+
];
|
|
3
21
|
export function registerGetLeaderboard(server, client) {
|
|
4
22
|
server.registerTool("get_leaderboard", {
|
|
5
23
|
title: "Get Trader Leaderboard",
|
|
@@ -9,7 +27,7 @@ Args:
|
|
|
9
27
|
- limit (number, 1-100, default 20): Max results per page
|
|
10
28
|
- cursor (string, optional): Pagination cursor from previous response
|
|
11
29
|
- category (string, optional): Filter by category slug
|
|
12
|
-
- strategy (string, optional):
|
|
30
|
+
- strategy (string, optional): One of accumulator, algo_trader, arbitrageur, directional, event_driven, market_maker, momentum, scalper, speculator, swing_trader
|
|
13
31
|
|
|
14
32
|
Returns: Ranked list of traders with grade, score, P&L, volume, win rate, and strategy.`,
|
|
15
33
|
inputSchema: {
|
|
@@ -19,7 +37,7 @@ Returns: Ranked list of traders with grade, score, P&L, volume, win rate, and st
|
|
|
19
37
|
.describe("Pagination cursor from previous response"),
|
|
20
38
|
category: z.string().optional()
|
|
21
39
|
.describe("Filter by category slug"),
|
|
22
|
-
strategy: z.
|
|
40
|
+
strategy: z.enum(LEADERBOARD_STRATEGIES).optional()
|
|
23
41
|
.describe("Filter by strategy type"),
|
|
24
42
|
},
|
|
25
43
|
annotations: {
|
|
@@ -36,20 +54,13 @@ Returns: Ranked list of traders with grade, score, P&L, volume, win rate, and st
|
|
|
36
54
|
category,
|
|
37
55
|
strategy,
|
|
38
56
|
});
|
|
39
|
-
const result =
|
|
40
|
-
data: response.data,
|
|
41
|
-
has_more: response.has_more,
|
|
42
|
-
next_cursor: response.next_cursor,
|
|
43
|
-
};
|
|
57
|
+
const result = listResult(response);
|
|
44
58
|
return {
|
|
45
59
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
46
60
|
};
|
|
47
61
|
}
|
|
48
62
|
catch (error) {
|
|
49
|
-
return
|
|
50
|
-
isError: true,
|
|
51
|
-
content: [{ type: "text", text: error instanceof ApiError ? error.message : `Unexpected error: ${error}` }],
|
|
52
|
-
};
|
|
63
|
+
return fail(error);
|
|
53
64
|
}
|
|
54
65
|
});
|
|
55
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-leaderboard.js","sourceRoot":"","sources":["../../src/tools/get-leaderboard.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"get-leaderboard.js","sourceRoot":"","sources":["../../src/tools/get-leaderboard.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,sBAAsB,GAAG;IAC7B,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,cAAc;IACd,cAAc;IACd,UAAU;IACV,SAAS;IACT,YAAY;IACZ,cAAc;CACN,CAAC;AAEX,MAAM,UAAU,sBAAsB,CAAC,MAAiB,EAAE,MAAiB;IACzE,MAAM,CA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AAC;YACf,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-market-intel.d.ts","sourceRoot":"","sources":["../../src/tools/get-market-intel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"get-market-intel.d.ts","sourceRoot":"","sources":["../../src/tools/get-market-intel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CA0CjF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { fail, withMeta } from "./result.js";
|
|
3
3
|
export function registerGetMarketIntel(server, client) {
|
|
4
4
|
server.registerTool("get_market_intel", {
|
|
5
5
|
title: "Get Market Intelligence",
|
|
@@ -28,14 +28,11 @@ Returns: Market info, smart money flow (net_flow_usd, direction YES/NO, volumes)
|
|
|
28
28
|
try {
|
|
29
29
|
const response = await client.request(`/api/v1/market/${encodeURIComponent(condition_id)}/intel`, { timeframe });
|
|
30
30
|
return {
|
|
31
|
-
content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }],
|
|
31
|
+
content: [{ type: "text", text: JSON.stringify(withMeta(response.data, response.meta), null, 2) }],
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
catch (error) {
|
|
35
|
-
return
|
|
36
|
-
isError: true,
|
|
37
|
-
content: [{ type: "text", text: error instanceof ApiError ? error.message : `Unexpected error: ${error}` }],
|
|
38
|
-
};
|
|
35
|
+
return fail(error);
|
|
39
36
|
}
|
|
40
37
|
});
|
|
41
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-market-intel.js","sourceRoot":"","sources":["../../src/tools/get-market-intel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"get-market-intel.js","sourceRoot":"","sources":["../../src/tools/get-market-intel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,UAAU,sBAAsB,CAAC,MAAiB,EAAE,MAAiB;IACzE,MAAM,CAAC,YAAY,CACjB,kBAAkB,EAClB;QACE,KAAK,EAAE,yBAAyB;QAChC,WAAW,EAAE;;;;;;;;8GAQ2F;QACxG,WAAW,EAAE;YACX,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;iBACrB,QAAQ,CAAC,qBAAqB,CAAC;YAClC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;iBACxD,QAAQ,CAAC,+BAA+B,CAAC;SAC7C;QACD,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,KAAK;SACrB;KACF,EACD,KAAK,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE;QACpC,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CACnC,kBAAkB,kBAAkB,CAAC,YAAY,CAAC,QAAQ,EAC1D,EAAE,SAAS,EAAE,CACd,CAAC;YAEF,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aAC5G,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-position-timeline.d.ts","sourceRoot":"","sources":["../../src/tools/get-position-timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"get-position-timeline.d.ts","sourceRoot":"","sources":["../../src/tools/get-position-timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,KAAK,oBAAoB,GAAG;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,4BAA4B;IACvC,YAAY;IAEZ,OAAO;IAEP,SAAS;IAET,KAAK;IAEL,MAAM;CAEP,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,oBAAoB,GAAG;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;CACrD,CA0BA;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CAsCtF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { fail, listResult } from "./result.js";
|
|
3
3
|
export const positionTimelineParamsSchema = {
|
|
4
4
|
condition_id: z.string().trim().min(1)
|
|
5
5
|
.describe("Market condition ID"),
|
|
@@ -59,20 +59,13 @@ Returns: List of position timeline events with pagination metadata.`,
|
|
|
59
59
|
try {
|
|
60
60
|
const request = buildPositionTimelineRequest(args);
|
|
61
61
|
const response = await client.request(request.path, request.params);
|
|
62
|
-
const result =
|
|
63
|
-
data: response.data,
|
|
64
|
-
has_more: response.has_more,
|
|
65
|
-
next_cursor: response.next_cursor,
|
|
66
|
-
};
|
|
62
|
+
const result = listResult(response);
|
|
67
63
|
return {
|
|
68
64
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
69
65
|
};
|
|
70
66
|
}
|
|
71
67
|
catch (error) {
|
|
72
|
-
return
|
|
73
|
-
isError: true,
|
|
74
|
-
content: [{ type: "text", text: error instanceof ApiError ? error.message : `Unexpected error: ${error}` }],
|
|
75
|
-
};
|
|
68
|
+
return fail(error);
|
|
76
69
|
}
|
|
77
70
|
});
|
|
78
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-position-timeline.js","sourceRoot":"","sources":["../../src/tools/get-position-timeline.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"get-position-timeline.js","sourceRoot":"","sources":["../../src/tools/get-position-timeline.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAU/C,MAAM,CAAC,MAAM,4BAA4B,GAAG;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chema: {
|
|
|
6
6
|
cursor: z.ZodOptional<z.ZodString>;
|
|
7
7
|
min_size: z.ZodDefault<z.ZodNumber>;
|
|
8
8
|
category: z.ZodOptional<z.ZodString>;
|
|
9
|
+
condition_id: z.ZodOptional<z.ZodString>;
|
|
9
10
|
min_grade: z.ZodOptional<z.ZodEnum<{
|
|
10
11
|
A: "A";
|
|
11
12
|
B: "B";
|
|
@@ -24,6 +25,7 @@ export declare function buildPositionsParams(args: {
|
|
|
24
25
|
cursor?: string;
|
|
25
26
|
min_size?: number;
|
|
26
27
|
category?: string;
|
|
28
|
+
condition_id?: string;
|
|
27
29
|
min_grade?: "S" | "A" | "B" | "C" | "D" | "F";
|
|
28
30
|
side?: "yes" | "no";
|
|
29
31
|
}): Record<string, string | number | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-positions.d.ts","sourceRoot":"","sources":["../../src/tools/get-positions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"get-positions.d.ts","sourceRoot":"","sources":["../../src/tools/get-positions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,eAAO,MAAM,qBAAqB;IAChC,KAAK;IAEL,MAAM;IAEN,QAAQ;IAER,QAAQ;IAER,YAAY;IAEZ,SAAS;;;;;;;;IAET,IAAI;;;;CAEL,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC9C,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAU9C;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CA0C/E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { fail, listResult } from "./result.js";
|
|
3
3
|
export const positionsParamsSchema = {
|
|
4
4
|
limit: z.number().int().min(1).max(100).default(20)
|
|
5
5
|
.describe("Max results (1-100, default 20)"),
|
|
@@ -9,6 +9,8 @@ export const positionsParamsSchema = {
|
|
|
9
9
|
.describe("Minimum current position value in USD"),
|
|
10
10
|
category: z.string().optional()
|
|
11
11
|
.describe("Filter by provider-backed market category"),
|
|
12
|
+
condition_id: z.string().optional()
|
|
13
|
+
.describe("Scope to one market: raw provider condition_id or mkt_-prefixed market id"),
|
|
12
14
|
min_grade: z.enum(["S", "A", "B", "C", "D", "F"]).optional()
|
|
13
15
|
.describe("Minimum trader grade"),
|
|
14
16
|
side: z.enum(["yes", "no"]).optional()
|
|
@@ -20,6 +22,7 @@ export function buildPositionsParams(args) {
|
|
|
20
22
|
cursor: args.cursor,
|
|
21
23
|
min_size: args.min_size,
|
|
22
24
|
category: args.category,
|
|
25
|
+
condition_id: args.condition_id,
|
|
23
26
|
min_grade: args.min_grade,
|
|
24
27
|
side: args.side,
|
|
25
28
|
};
|
|
@@ -32,8 +35,9 @@ export function registerGetPositions(server, client) {
|
|
|
32
35
|
Args:
|
|
33
36
|
- limit (number, 1-100, default 20): Max results per page
|
|
34
37
|
- cursor (string, optional): Pagination cursor from previous response
|
|
35
|
-
- min_size (number, default 100): Minimum current value in USD
|
|
38
|
+
- min_size (number, default 100): Minimum current value in USD; send 0 for every reconciled position
|
|
36
39
|
- category (string, optional): Filter by provider-backed market category
|
|
40
|
+
- condition_id (string, optional): Scope to one market: raw provider condition_id or mkt_-prefixed market id
|
|
37
41
|
- min_grade (string, optional): Minimum trader grade (S, A, B, C, D, F)
|
|
38
42
|
- side (string, optional): Filter by binary side: "yes" or "no"
|
|
39
43
|
|
|
@@ -48,20 +52,13 @@ Returns: List of current positions with pagination metadata.`,
|
|
|
48
52
|
}, async (args) => {
|
|
49
53
|
try {
|
|
50
54
|
const response = await client.request("/api/v1/positions", buildPositionsParams(args));
|
|
51
|
-
const result =
|
|
52
|
-
data: response.data,
|
|
53
|
-
has_more: response.has_more,
|
|
54
|
-
next_cursor: response.next_cursor,
|
|
55
|
-
};
|
|
55
|
+
const result = listResult(response);
|
|
56
56
|
return {
|
|
57
57
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
catch (error) {
|
|
61
|
-
return
|
|
62
|
-
isError: true,
|
|
63
|
-
content: [{ type: "text", text: error instanceof ApiError ? error.message : `Unexpected error: ${error}` }],
|
|
64
|
-
};
|
|
61
|
+
return fail(error);
|
|
65
62
|
}
|
|
66
63
|
});
|
|
67
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-positions.js","sourceRoot":"","sources":["../../src/tools/get-positions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"get-positions.js","sourceRoot":"","sources":["../../src/tools/get-positions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,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;QACzB,IAAI,EAAE,IAAI,CAAC,IAAI;KAChB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,MAAiB,EAAE,MAAiB;IACvE,MAAM,CAAC,YAAY,CACjB,eAAe,EACf;QACE,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EAAE;;;;;;;;;;;6DAW0C;QACvD,WAAW,EAAE,qBAAqB;QAClC,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,KAAK;SACrB;KACF,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CACnC,mBAAmB,EACnB,oBAAoB,CAAC,IAAI,CAAC,CAC3B,CAAC;YAEF,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;YAEpC,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aAC5E,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { ApiClient } from "../client.js";
|
|
4
|
+
/** Shared by the canonical list tool and its deprecated alias. */
|
|
5
|
+
export declare const suspiciousTradesInputSchema: {
|
|
6
|
+
readonly limit: z.ZodDefault<z.ZodNumber>;
|
|
7
|
+
readonly cursor: z.ZodOptional<z.ZodString>;
|
|
8
|
+
readonly min_suspicion: z.ZodDefault<z.ZodNumber>;
|
|
9
|
+
readonly severity: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
flag: "flag";
|
|
11
|
+
watch: "watch";
|
|
12
|
+
}>>;
|
|
13
|
+
readonly mode: z.ZodOptional<z.ZodEnum<{
|
|
14
|
+
live: "live";
|
|
15
|
+
stable: "stable";
|
|
16
|
+
}>>;
|
|
17
|
+
};
|
|
18
|
+
/** Shared by the canonical by-ID tool and its deprecated alias. */
|
|
19
|
+
export declare const suspiciousTradeInputSchema: {
|
|
20
|
+
readonly id: z.ZodString;
|
|
21
|
+
};
|
|
22
|
+
export declare const SUSPICIOUS_TRADES_DESCRIPTION = "Stored trades whose recorded suspicion score meets the live flag threshold. Cursor-paginated by suspicion score (highest first). Use mode=stable when a walk must stay on one published scoring generation; restart when it returns cursor_expired.\n\nEach suspicious trade includes:\n- suspicion_score (60-100)\n- severity (currently flag)\n- Sub-scores: size and fresh_wallet when recorded; timing and edge are null\n- Evidence JSON with the scorer's stored signals\n\nArgs:\n - limit (number, 1-100, default 20): Max results per page\n - cursor (string, optional): Pagination cursor from previous response\n - min_suspicion (number, 0-100, default 0): Minimum score; the live floor of 60 also applies\n - severity (string, optional): \"flag\" selects live rows; \"watch\" returns none because no live watch policy exists\n - mode (string, optional): \"live\" (default) uses fresh cached pages; \"stable\" pins the walk to one published scoring generation\n\nReturns: List of suspicious trades with trader, market, scores, and evidence.";
|
|
23
|
+
export declare const SUSPICIOUS_TRADE_DESCRIPTION = "Read one suspicious trade by ID. Accepts the rf_ ID returned by list responses or the raw numeric whale_alerts.id.\n\nArgs:\n - id (string, required): Suspicious trade ID such as rf_123 or 123\n\nReturns: One suspicious trade with trader, market, suspicion scores, and evidence.";
|
|
24
|
+
export declare function registerGetSuspiciousTrades(server: McpServer, client: ApiClient): void;
|
|
25
|
+
export declare function registerGetSuspiciousTrade(server: McpServer, client: ApiClient): void;
|
|
26
|
+
//# sourceMappingURL=get-suspicious-trades.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-suspicious-trades.d.ts","sourceRoot":"","sources":["../../src/tools/get-suspicious-trades.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAUzC,kEAAkE;AAClE,eAAO,MAAM,2BAA2B;aACtC,KAAK;aAEL,MAAM;aAEN,aAAa;aAEb,QAAQ;;;;aAER,IAAI;;;;CAEI,CAAC;AAEX,mEAAmE;AACnE,eAAO,MAAM,0BAA0B;aACrC,EAAE;CACM,CAAC;AAEX,eAAO,MAAM,6BAA6B,mhCAeoC,CAAC;AAE/E,eAAO,MAAM,4BAA4B,4RAK0C,CAAC;AAEpF,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CAwBtF;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CAoBrF"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// Canonical "suspicious trades" tools (#16301, epic #16300). The wording and
|
|
2
|
+
// the argument list mirror `backend/src/mcp/tools/contract.rs`, so the remote
|
|
3
|
+
// endpoint and this stdio server describe the same surface. The older
|
|
4
|
+
// get_insider_radar / get_insider_radar_flag tools stay registered as
|
|
5
|
+
// deprecated aliases on the deprecated /api/v1/insider-radar paths.
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { fail, listResult, ok, withMeta } from "./result.js";
|
|
8
|
+
const readAnnotations = {
|
|
9
|
+
readOnlyHint: true,
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
idempotentHint: true,
|
|
12
|
+
openWorldHint: false,
|
|
13
|
+
};
|
|
14
|
+
/** Shared by the canonical list tool and its deprecated alias. */
|
|
15
|
+
export const suspiciousTradesInputSchema = {
|
|
16
|
+
limit: z.number().int().min(1).max(100).default(20)
|
|
17
|
+
.describe("Max results (1-100, default 20)"),
|
|
18
|
+
cursor: z.string().optional()
|
|
19
|
+
.describe("Pagination cursor from previous response"),
|
|
20
|
+
min_suspicion: z.number().min(0).max(100).default(0)
|
|
21
|
+
.describe("Minimum suspicion score (0-100); the live floor of 60 also applies"),
|
|
22
|
+
severity: z.enum(["flag", "watch"]).optional()
|
|
23
|
+
.describe('"flag" selects live rows; "watch" returns none because no live watch policy exists'),
|
|
24
|
+
mode: z.enum(["live", "stable"]).optional()
|
|
25
|
+
.describe('"live" (default) uses fresh cached pages; "stable" pins the walk to one published scoring generation'),
|
|
26
|
+
};
|
|
27
|
+
/** Shared by the canonical by-ID tool and its deprecated alias. */
|
|
28
|
+
export const suspiciousTradeInputSchema = {
|
|
29
|
+
id: z.string().trim().min(1).describe("Suspicious trade ID such as rf_123 or 123"),
|
|
30
|
+
};
|
|
31
|
+
export const SUSPICIOUS_TRADES_DESCRIPTION = `Stored trades whose recorded suspicion score meets the live flag threshold. Cursor-paginated by suspicion score (highest first). Use mode=stable when a walk must stay on one published scoring generation; restart when it returns cursor_expired.
|
|
32
|
+
|
|
33
|
+
Each suspicious trade includes:
|
|
34
|
+
- suspicion_score (60-100)
|
|
35
|
+
- severity (currently flag)
|
|
36
|
+
- Sub-scores: size and fresh_wallet when recorded; timing and edge are null
|
|
37
|
+
- Evidence JSON with the scorer's stored signals
|
|
38
|
+
|
|
39
|
+
Args:
|
|
40
|
+
- limit (number, 1-100, default 20): Max results per page
|
|
41
|
+
- cursor (string, optional): Pagination cursor from previous response
|
|
42
|
+
- min_suspicion (number, 0-100, default 0): Minimum score; the live floor of 60 also applies
|
|
43
|
+
- severity (string, optional): "flag" selects live rows; "watch" returns none because no live watch policy exists
|
|
44
|
+
- mode (string, optional): "live" (default) uses fresh cached pages; "stable" pins the walk to one published scoring generation
|
|
45
|
+
|
|
46
|
+
Returns: List of suspicious trades with trader, market, scores, and evidence.`;
|
|
47
|
+
export const SUSPICIOUS_TRADE_DESCRIPTION = `Read one suspicious trade by ID. Accepts the rf_ ID returned by list responses or the raw numeric whale_alerts.id.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
- id (string, required): Suspicious trade ID such as rf_123 or 123
|
|
51
|
+
|
|
52
|
+
Returns: One suspicious trade with trader, market, suspicion scores, and evidence.`;
|
|
53
|
+
export function registerGetSuspiciousTrades(server, client) {
|
|
54
|
+
server.registerTool("get_suspicious_trades", {
|
|
55
|
+
title: "Get suspicious trades",
|
|
56
|
+
description: SUSPICIOUS_TRADES_DESCRIPTION,
|
|
57
|
+
inputSchema: suspiciousTradesInputSchema,
|
|
58
|
+
annotations: readAnnotations,
|
|
59
|
+
}, async ({ limit, cursor, min_suspicion, severity, mode }) => {
|
|
60
|
+
try {
|
|
61
|
+
const response = await client.request("/api/v1/suspicious-trades", {
|
|
62
|
+
limit,
|
|
63
|
+
cursor,
|
|
64
|
+
min_suspicion,
|
|
65
|
+
severity,
|
|
66
|
+
mode,
|
|
67
|
+
});
|
|
68
|
+
return ok(listResult(response));
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
return fail(error);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
export function registerGetSuspiciousTrade(server, client) {
|
|
76
|
+
server.registerTool("get_suspicious_trade", {
|
|
77
|
+
title: "Get suspicious trade",
|
|
78
|
+
description: SUSPICIOUS_TRADE_DESCRIPTION,
|
|
79
|
+
inputSchema: suspiciousTradeInputSchema,
|
|
80
|
+
annotations: readAnnotations,
|
|
81
|
+
}, async ({ id }) => {
|
|
82
|
+
try {
|
|
83
|
+
const response = await client.request(`/api/v1/suspicious-trades/${encodeURIComponent(id)}`);
|
|
84
|
+
return ok(withMeta(response.data, response.meta));
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
return fail(error);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=get-su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,EAAE,EAAE,EAAE,EAAE;QACf,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CACnC,6BAA6B,kBAAkB,CAAC,EAAE,CAAC,EAAE,CACtD,CAAC;YACF,OAAO,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QACpD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-trader-pnl.d.ts","sourceRoot":"","sources":["../../src/tools/get-trader-pnl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"get-trader-pnl.d.ts","sourceRoot":"","sources":["../../src/tools/get-trader-pnl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,eAAO,MAAM,qBAAqB,aAAoC,CAAC;AAEvE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CAqC/E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { fail, withMeta } from "./result.js";
|
|
3
3
|
export const traderPnlLookupSchema = z.string().trim().min(1).max(100);
|
|
4
4
|
export function registerGetTraderPnl(server, client) {
|
|
5
5
|
server.registerTool("get_trader_pnl", {
|
|
@@ -25,14 +25,11 @@ Returns: Trader daily P&L time series with period stats, monthly aggregation, pe
|
|
|
25
25
|
const traderLookup = address.trim();
|
|
26
26
|
const response = await client.request(`/api/v1/trader/${encodeURIComponent(traderLookup)}/pnl`);
|
|
27
27
|
return {
|
|
28
|
-
content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }],
|
|
28
|
+
content: [{ type: "text", text: JSON.stringify(withMeta(response.data, response.meta), null, 2) }],
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
catch (error) {
|
|
32
|
-
return
|
|
33
|
-
isError: true,
|
|
34
|
-
content: [{ type: "text", text: error instanceof ApiError ? error.message : `Unexpected error: ${error}` }],
|
|
35
|
-
};
|
|
32
|
+
return fail(error);
|
|
36
33
|
}
|
|
37
34
|
});
|
|
38
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-trader-pnl.js","sourceRoot":"","sources":["../../src/tools/get-trader-pnl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"get-trader-pnl.js","sourceRoot":"","sources":["../../src/tools/get-trader-pnl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEvE,MAAM,UAAU,oBAAoB,CAAC,MAAiB,EAAE,MAAiB;IACvE,MAAM,CAAC,YAAY,CACjB,gBAAgB,EAChB;QACE,KAAK,EAAE,4BAA4B;QACnC,WAAW,EAAE;;;;;oHAKiG;QAC9G,WAAW,EAAE;YACX,OAAO,EAAE,qBAAqB;iBAC3B,QAAQ,CAAC,uEAAuE,CAAC;SACrF;QACD,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,KAAK;SACrB;KACF,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACpB,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;YACpC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CACnC,kBAAkB,kBAAkB,CAAC,YAAY,CAAC,MAAM,CACzD,CAAC;YAEF,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aAC5G,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-trader.d.ts","sourceRoot":"","sources":["../../src/tools/get-trader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"get-trader.d.ts","sourceRoot":"","sources":["../../src/tools/get-trader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,eAAO,MAAM,kBAAkB,aAAoC,CAAC;AAEpE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CAuD5E"}
|
package/dist/tools/get-trader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { fail, withMeta } from "./result.js";
|
|
3
3
|
export const traderLookupSchema = z.string().trim().min(1).max(100);
|
|
4
4
|
export function registerGetTrader(server, client) {
|
|
5
5
|
server.registerTool("get_trader", {
|
|
@@ -40,14 +40,11 @@ Returns: Trader profile with grade, P&L, stats, and optional expanded fields.`,
|
|
|
40
40
|
: undefined;
|
|
41
41
|
const response = await client.request(`/api/v1/trader/${encodeURIComponent(traderLookup)}`, undefined, repeatedParams);
|
|
42
42
|
return {
|
|
43
|
-
content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }],
|
|
43
|
+
content: [{ type: "text", text: JSON.stringify(withMeta(response.data, response.meta), null, 2) }],
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
catch (error) {
|
|
47
|
-
return
|
|
48
|
-
isError: true,
|
|
49
|
-
content: [{ type: "text", text: error instanceof ApiError ? error.message : `Unexpected error: ${error}` }],
|
|
50
|
-
};
|
|
47
|
+
return fail(error);
|
|
51
48
|
}
|
|
52
49
|
});
|
|
53
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-trader.js","sourceRoot":"","sources":["../../src/tools/get-trader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"get-trader.js","sourceRoot":"","sources":["../../src/tools/get-trader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAA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