@michaleffffff/mcp-trading-server 2.9.9 → 3.0.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/CHANGELOG.md +22 -0
- package/README.md +101 -5
- package/TOOL_EXAMPLES.md +536 -0
- package/dist/prompts/tradingGuide.js +7 -4
- package/dist/server.js +215 -15
- package/dist/services/marketService.js +101 -21
- package/dist/tools/accountInfo.js +119 -49
- package/dist/tools/index.js +1 -2
- package/dist/tools/searchMarket.js +3 -3
- package/package.json +5 -2
- package/dist/tools/getBalances.js +0 -17
|
@@ -3,15 +3,15 @@ import { resolveClient } from "../auth/resolveClient.js";
|
|
|
3
3
|
import { searchMarket } from "../services/marketService.js";
|
|
4
4
|
export const searchMarketTool = {
|
|
5
5
|
name: "search_market",
|
|
6
|
-
description: "Search
|
|
6
|
+
description: "Search active markets by keyword. Leave keyword empty to list active markets.",
|
|
7
7
|
schema: {
|
|
8
|
-
keyword: z.string().describe('Search keyword, e.g. "BTC", "ETH"'),
|
|
8
|
+
keyword: z.string().optional().describe('Search keyword, e.g. "BTC", "ETH". Leave empty to return active markets.'),
|
|
9
9
|
limit: z.number().int().positive().optional().describe("Max results (default 100)"),
|
|
10
10
|
},
|
|
11
11
|
handler: async (args) => {
|
|
12
12
|
try {
|
|
13
13
|
const { client } = await resolveClient();
|
|
14
|
-
const activeMarkets = await searchMarket(client, args.keyword, args.limit);
|
|
14
|
+
const activeMarkets = await searchMarket(client, args.keyword ?? "", args.limit ?? 100);
|
|
15
15
|
return { content: [{ type: "text", text: JSON.stringify({ status: "success", data: activeMarkets }, (_, v) => typeof v === 'bigint' ? v.toString() : v, 2) }] };
|
|
16
16
|
}
|
|
17
17
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michaleffffff/mcp-trading-server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"myx-mcp": "dist/server.js"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
|
-
"dist"
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md",
|
|
11
|
+
"TOOL_EXAMPLES.md",
|
|
12
|
+
"CHANGELOG.md"
|
|
10
13
|
],
|
|
11
14
|
"scripts": {
|
|
12
15
|
"build": "rm -rf dist && tsc",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { resolveClient } from "../auth/resolveClient.js";
|
|
2
|
-
import { getBalances } from "../services/balanceService.js";
|
|
3
|
-
export const getBalancesTool = {
|
|
4
|
-
name: "get_balances",
|
|
5
|
-
description: "Get the account balances for different tokens.",
|
|
6
|
-
schema: {},
|
|
7
|
-
handler: async () => {
|
|
8
|
-
try {
|
|
9
|
-
const { client, address } = await resolveClient();
|
|
10
|
-
const data = await getBalances(client, address);
|
|
11
|
-
return { content: [{ type: "text", text: JSON.stringify({ status: "success", data }, (_, v) => typeof v === 'bigint' ? v.toString() : v, 2) }] };
|
|
12
|
-
}
|
|
13
|
-
catch (error) {
|
|
14
|
-
return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true };
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
};
|