gm-mcp 1.3.6 → 1.3.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/index.js +125 -90
- package/package.json +1 -1
- package/src/index.ts +126 -129
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ exports.server = void 0;
|
|
|
17
17
|
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
18
18
|
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
19
19
|
const tools_1 = require("./tools");
|
|
20
|
-
const
|
|
20
|
+
const v4_1 = __importDefault(require("zod/v4"));
|
|
21
21
|
const env_1 = require("./env");
|
|
22
22
|
const lark_tool_1 = require("./tools/lark-tool");
|
|
23
23
|
const product_type_1 = require("./services/constants/product-type");
|
|
@@ -39,37 +39,47 @@ exports.server.tool("statistic_salary_x3_this_week", "Get statistic salary x3 th
|
|
|
39
39
|
return (0, tools_1.statisticX3WeekTool)({ sendMessageToLark: (0, env_1.getEnv)().SEND_MESSAGE_TO_LARK === "true" });
|
|
40
40
|
}));
|
|
41
41
|
exports.server.tool("statistic_salary_x3_month", `Get statistic salary x3 with month`, {
|
|
42
|
-
month:
|
|
42
|
+
month: v4_1.default.string().describe("Month to statistic, month must be represented with format MM/yyyy"),
|
|
43
43
|
}, (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
44
|
return (0, tools_1.statisticX3MonthTool)({ sendMessageToLark: (0, env_1.getEnv)().SEND_MESSAGE_TO_LARK === "true", month: args.month });
|
|
45
45
|
}));
|
|
46
46
|
exports.server.tool("statistic_salary_x3_this_month", `Get statistic salary x3 this month`, {}, (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
47
|
return (0, tools_1.statisticX3ThisMonthTool)({ sendMessageToLark: (0, env_1.getEnv)().SEND_MESSAGE_TO_LARK === "true" });
|
|
48
48
|
}));
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
49
|
+
// server.tool(
|
|
50
|
+
// "statistic_salary_x3",
|
|
51
|
+
// "Get statistic salary x3 with specific date,date must be formated in dd/mm/yyy or dd-mm-yyyy",
|
|
52
|
+
// {
|
|
53
|
+
// date: z.string({
|
|
54
|
+
// description: "Date to statistic with format dd/mm/yyy or dd-mm-yyyy",
|
|
55
|
+
// }),
|
|
56
|
+
// },
|
|
57
|
+
// async (args) => {
|
|
58
|
+
// return statisticX3Tool({
|
|
59
|
+
// date: args.date,
|
|
60
|
+
// sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
|
|
61
|
+
// });
|
|
62
|
+
// }
|
|
63
|
+
// );
|
|
64
|
+
// server.tool(
|
|
65
|
+
// "statistic_salary_x3_in_range",
|
|
66
|
+
// "Get statistic salary x3 with range of date,date must be formated in dd/mm/yyy or dd-mm-yyyy",
|
|
67
|
+
// {
|
|
68
|
+
// start_date: z.string({
|
|
69
|
+
// description: "Start date to statistic with format dd/mm/yyy or dd-mm-yyyy",
|
|
70
|
+
// }),
|
|
71
|
+
// end_date: z.string({
|
|
72
|
+
// description: "End date to statistic with format dd/mm/yyy or dd-mm-yyyy",
|
|
73
|
+
// }),
|
|
74
|
+
// },
|
|
75
|
+
// async (args) => {
|
|
76
|
+
// return statisticX3RangeTool({
|
|
77
|
+
// startDateStr: args.start_date,
|
|
78
|
+
// endDateStr: args.end_date,
|
|
79
|
+
// sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
|
|
80
|
+
// });
|
|
81
|
+
// }
|
|
82
|
+
// );
|
|
73
83
|
exports.server.registerTool("debt_collection", {
|
|
74
84
|
description: `
|
|
75
85
|
The company's debt collection, follow by these criteria:
|
|
@@ -77,18 +87,16 @@ exports.server.registerTool("debt_collection", {
|
|
|
77
87
|
- year (optional), if it is not provided use default value
|
|
78
88
|
- product (optional), if it is not provided use default value
|
|
79
89
|
`,
|
|
80
|
-
inputSchema:
|
|
81
|
-
company_name:
|
|
82
|
-
year:
|
|
83
|
-
.string(
|
|
84
|
-
|
|
85
|
-
})
|
|
90
|
+
inputSchema: v4_1.default.object({
|
|
91
|
+
company_name: v4_1.default.string().describe("Company name to get data"),
|
|
92
|
+
year: v4_1.default
|
|
93
|
+
.string()
|
|
94
|
+
.describe("Year to get company debt collection,if year is not provided use this year (vietname time zone)")
|
|
86
95
|
.default("2025")
|
|
87
96
|
.optional(),
|
|
88
|
-
product_type:
|
|
89
|
-
.string(
|
|
90
|
-
|
|
91
|
-
})
|
|
97
|
+
product_type: v4_1.default
|
|
98
|
+
.string()
|
|
99
|
+
.describe("Product type to get data one of follow values EWA 02 - 03 | EWA 04 | Lương X3 | Lương X3 - EVF ")
|
|
92
100
|
.default(product_type_1.PRODUCT_TYPE.EWA_02_03)
|
|
93
101
|
.optional(),
|
|
94
102
|
}),
|
|
@@ -100,60 +108,87 @@ exports.server.registerTool("debt_collection", {
|
|
|
100
108
|
productType: product_type,
|
|
101
109
|
});
|
|
102
110
|
}));
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
111
|
+
// server.tool(
|
|
112
|
+
// "debt_collection_with_month",
|
|
113
|
+
// "The company's debt collection information with month",
|
|
114
|
+
// {
|
|
115
|
+
// month: z
|
|
116
|
+
// .string()
|
|
117
|
+
// .describe(
|
|
118
|
+
// "Month to get data,if year is not provided, please use current year (in Vietnam timezone) instead of, month is represented with format MM/yyyy"
|
|
119
|
+
// ),
|
|
120
|
+
// company_name: z.string({ description: "Company name to get data" }),
|
|
121
|
+
// },
|
|
122
|
+
// async (args) => {
|
|
123
|
+
// const { month, company_name } = args;
|
|
124
|
+
// return debtCollectionRateTool({
|
|
125
|
+
// sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
|
|
126
|
+
// monthDate: month,
|
|
127
|
+
// companyName: company_name,
|
|
128
|
+
// productType: PRODUCT_TYPE.EWA_02_03,
|
|
129
|
+
// });
|
|
130
|
+
// }
|
|
131
|
+
// );
|
|
132
|
+
// server.tool(
|
|
133
|
+
// "debt_collection_ewa_02",
|
|
134
|
+
// "The company's debt collection information with EWA 02 - 03 product type",
|
|
135
|
+
// {
|
|
136
|
+
// company_name: z.string({ description: "Company name to get data" }),
|
|
137
|
+
// },
|
|
138
|
+
// async (args) => {
|
|
139
|
+
// const { company_name } = args;
|
|
140
|
+
// return debtCollectionRateTool({
|
|
141
|
+
// sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
|
|
142
|
+
// companyName: company_name,
|
|
143
|
+
// productType: PRODUCT_TYPE.EWA_02_03,
|
|
144
|
+
// });
|
|
145
|
+
// }
|
|
146
|
+
// );
|
|
147
|
+
// server.tool(
|
|
148
|
+
// "debt_collection_ewa_04",
|
|
149
|
+
// "The company's debt collection information with EWA 04 product type",
|
|
150
|
+
// {
|
|
151
|
+
// company_name: z.string({ description: "Company name to get data" }),
|
|
152
|
+
// },
|
|
153
|
+
// async (args) => {
|
|
154
|
+
// const { company_name } = args;
|
|
155
|
+
// return debtCollectionRateTool({
|
|
156
|
+
// sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
|
|
157
|
+
// companyName: company_name,
|
|
158
|
+
// productType: PRODUCT_TYPE.EWA_04,
|
|
159
|
+
// });
|
|
160
|
+
// }
|
|
161
|
+
// );
|
|
162
|
+
// server.tool(
|
|
163
|
+
// "debt_collection_x3",
|
|
164
|
+
// "The company's debt collection information with Lương X3 product type",
|
|
165
|
+
// {
|
|
166
|
+
// company_name: z.string({ description: "Company name to get data" }),
|
|
167
|
+
// },
|
|
168
|
+
// async (args) => {
|
|
169
|
+
// const { company_name } = args;
|
|
170
|
+
// return debtCollectionRateTool({
|
|
171
|
+
// sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
|
|
172
|
+
// companyName: company_name,
|
|
173
|
+
// productType: PRODUCT_TYPE.X3,
|
|
174
|
+
// });
|
|
175
|
+
// }
|
|
176
|
+
// );
|
|
177
|
+
// server.tool(
|
|
178
|
+
// "debt_collection_x3_evf",
|
|
179
|
+
// "The company's debt collection information with Lương X3 - EVF product type",
|
|
180
|
+
// {
|
|
181
|
+
// company_name: z.string({ description: "Company name to get data" }),
|
|
182
|
+
// },
|
|
183
|
+
// async (args) => {
|
|
184
|
+
// const { company_name } = args;
|
|
185
|
+
// return debtCollectionRateTool({
|
|
186
|
+
// sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
|
|
187
|
+
// companyName: company_name,
|
|
188
|
+
// productType: PRODUCT_TYPE.X3_EVF,
|
|
189
|
+
// });
|
|
190
|
+
// }
|
|
191
|
+
// );
|
|
157
192
|
function bootstap() {
|
|
158
193
|
(0, env_1.ensureEnvVariables)();
|
|
159
194
|
const transport = new stdio_js_1.StdioServerTransport();
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
statisticX3WeekTool,
|
|
11
11
|
statisticX3YesterdayTool,
|
|
12
12
|
} from "./tools";
|
|
13
|
-
import z from "zod";
|
|
13
|
+
import z from "zod/v4";
|
|
14
14
|
import { ensureEnvVariables, getEnv } from "./env";
|
|
15
15
|
import { debtCollectionRateTool } from "./tools/lark-tool";
|
|
16
16
|
import { PRODUCT_TYPE } from "./services/constants/product-type";
|
|
@@ -54,41 +54,41 @@ server.tool("statistic_salary_x3_this_month", `Get statistic salary x3 this mont
|
|
|
54
54
|
return statisticX3ThisMonthTool({ sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true" });
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
-
server.tool(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
server.tool(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
);
|
|
57
|
+
// server.tool(
|
|
58
|
+
// "statistic_salary_x3",
|
|
59
|
+
// "Get statistic salary x3 with specific date,date must be formated in dd/mm/yyy or dd-mm-yyyy",
|
|
60
|
+
// {
|
|
61
|
+
// date: z.string({
|
|
62
|
+
// description: "Date to statistic with format dd/mm/yyy or dd-mm-yyyy",
|
|
63
|
+
// }),
|
|
64
|
+
// },
|
|
65
|
+
// async (args) => {
|
|
66
|
+
// return statisticX3Tool({
|
|
67
|
+
// date: args.date,
|
|
68
|
+
// sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
|
|
69
|
+
// });
|
|
70
|
+
// }
|
|
71
|
+
// );
|
|
72
|
+
|
|
73
|
+
// server.tool(
|
|
74
|
+
// "statistic_salary_x3_in_range",
|
|
75
|
+
// "Get statistic salary x3 with range of date,date must be formated in dd/mm/yyy or dd-mm-yyyy",
|
|
76
|
+
// {
|
|
77
|
+
// start_date: z.string({
|
|
78
|
+
// description: "Start date to statistic with format dd/mm/yyy or dd-mm-yyyy",
|
|
79
|
+
// }),
|
|
80
|
+
// end_date: z.string({
|
|
81
|
+
// description: "End date to statistic with format dd/mm/yyy or dd-mm-yyyy",
|
|
82
|
+
// }),
|
|
83
|
+
// },
|
|
84
|
+
// async (args) => {
|
|
85
|
+
// return statisticX3RangeTool({
|
|
86
|
+
// startDateStr: args.start_date,
|
|
87
|
+
// endDateStr: args.end_date,
|
|
88
|
+
// sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
|
|
89
|
+
// });
|
|
90
|
+
// }
|
|
91
|
+
// );
|
|
92
92
|
|
|
93
93
|
server.registerTool(
|
|
94
94
|
"debt_collection",
|
|
@@ -100,18 +100,15 @@ server.registerTool(
|
|
|
100
100
|
- product (optional), if it is not provided use default value
|
|
101
101
|
`,
|
|
102
102
|
inputSchema: z.object({
|
|
103
|
-
company_name: z.string(
|
|
103
|
+
company_name: z.string().describe("Company name to get data"),
|
|
104
104
|
year: z
|
|
105
|
-
.string(
|
|
106
|
-
|
|
107
|
-
})
|
|
105
|
+
.string()
|
|
106
|
+
.describe("Year to get company debt collection,if year is not provided use this year (vietname time zone)")
|
|
108
107
|
.default("2025")
|
|
109
108
|
.optional(),
|
|
110
109
|
product_type: z
|
|
111
|
-
.string(
|
|
112
|
-
|
|
113
|
-
"Product type to get data one of follow values EWA 02 - 03 | EWA 04 | Lương X3 | Lương X3 - EVF ",
|
|
114
|
-
})
|
|
110
|
+
.string()
|
|
111
|
+
.describe("Product type to get data one of follow values EWA 02 - 03 | EWA 04 | Lương X3 | Lương X3 - EVF ")
|
|
115
112
|
.default(PRODUCT_TYPE.EWA_02_03)
|
|
116
113
|
.optional(),
|
|
117
114
|
}),
|
|
@@ -126,91 +123,91 @@ server.registerTool(
|
|
|
126
123
|
}
|
|
127
124
|
);
|
|
128
125
|
|
|
129
|
-
server.tool(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
);
|
|
150
|
-
|
|
151
|
-
server.tool(
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
);
|
|
166
|
-
|
|
167
|
-
server.tool(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
);
|
|
182
|
-
|
|
183
|
-
server.tool(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
);
|
|
198
|
-
|
|
199
|
-
server.tool(
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
);
|
|
126
|
+
// server.tool(
|
|
127
|
+
// "debt_collection_with_month",
|
|
128
|
+
// "The company's debt collection information with month",
|
|
129
|
+
// {
|
|
130
|
+
// month: z
|
|
131
|
+
// .string()
|
|
132
|
+
// .describe(
|
|
133
|
+
// "Month to get data,if year is not provided, please use current year (in Vietnam timezone) instead of, month is represented with format MM/yyyy"
|
|
134
|
+
// ),
|
|
135
|
+
// company_name: z.string({ description: "Company name to get data" }),
|
|
136
|
+
// },
|
|
137
|
+
// async (args) => {
|
|
138
|
+
// const { month, company_name } = args;
|
|
139
|
+
// return debtCollectionRateTool({
|
|
140
|
+
// sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
|
|
141
|
+
// monthDate: month,
|
|
142
|
+
// companyName: company_name,
|
|
143
|
+
// productType: PRODUCT_TYPE.EWA_02_03,
|
|
144
|
+
// });
|
|
145
|
+
// }
|
|
146
|
+
// );
|
|
147
|
+
|
|
148
|
+
// server.tool(
|
|
149
|
+
// "debt_collection_ewa_02",
|
|
150
|
+
// "The company's debt collection information with EWA 02 - 03 product type",
|
|
151
|
+
// {
|
|
152
|
+
// company_name: z.string({ description: "Company name to get data" }),
|
|
153
|
+
// },
|
|
154
|
+
// async (args) => {
|
|
155
|
+
// const { company_name } = args;
|
|
156
|
+
// return debtCollectionRateTool({
|
|
157
|
+
// sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
|
|
158
|
+
// companyName: company_name,
|
|
159
|
+
// productType: PRODUCT_TYPE.EWA_02_03,
|
|
160
|
+
// });
|
|
161
|
+
// }
|
|
162
|
+
// );
|
|
163
|
+
|
|
164
|
+
// server.tool(
|
|
165
|
+
// "debt_collection_ewa_04",
|
|
166
|
+
// "The company's debt collection information with EWA 04 product type",
|
|
167
|
+
// {
|
|
168
|
+
// company_name: z.string({ description: "Company name to get data" }),
|
|
169
|
+
// },
|
|
170
|
+
// async (args) => {
|
|
171
|
+
// const { company_name } = args;
|
|
172
|
+
// return debtCollectionRateTool({
|
|
173
|
+
// sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
|
|
174
|
+
// companyName: company_name,
|
|
175
|
+
// productType: PRODUCT_TYPE.EWA_04,
|
|
176
|
+
// });
|
|
177
|
+
// }
|
|
178
|
+
// );
|
|
179
|
+
|
|
180
|
+
// server.tool(
|
|
181
|
+
// "debt_collection_x3",
|
|
182
|
+
// "The company's debt collection information with Lương X3 product type",
|
|
183
|
+
// {
|
|
184
|
+
// company_name: z.string({ description: "Company name to get data" }),
|
|
185
|
+
// },
|
|
186
|
+
// async (args) => {
|
|
187
|
+
// const { company_name } = args;
|
|
188
|
+
// return debtCollectionRateTool({
|
|
189
|
+
// sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
|
|
190
|
+
// companyName: company_name,
|
|
191
|
+
// productType: PRODUCT_TYPE.X3,
|
|
192
|
+
// });
|
|
193
|
+
// }
|
|
194
|
+
// );
|
|
195
|
+
|
|
196
|
+
// server.tool(
|
|
197
|
+
// "debt_collection_x3_evf",
|
|
198
|
+
// "The company's debt collection information with Lương X3 - EVF product type",
|
|
199
|
+
// {
|
|
200
|
+
// company_name: z.string({ description: "Company name to get data" }),
|
|
201
|
+
// },
|
|
202
|
+
// async (args) => {
|
|
203
|
+
// const { company_name } = args;
|
|
204
|
+
// return debtCollectionRateTool({
|
|
205
|
+
// sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
|
|
206
|
+
// companyName: company_name,
|
|
207
|
+
// productType: PRODUCT_TYPE.X3_EVF,
|
|
208
|
+
// });
|
|
209
|
+
// }
|
|
210
|
+
// );
|
|
214
211
|
|
|
215
212
|
function bootstap() {
|
|
216
213
|
ensureEnvVariables();
|