gm-mcp 1.3.7 → 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.
Files changed (3) hide show
  1. package/dist/index.js +125 -90
  2. package/package.json +1 -1
  3. 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 zod_1 = __importDefault(require("zod"));
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: zod_1.default.string().describe("Month to statistic, month must be represented with format MM/yyyy"),
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
- exports.server.tool("statistic_salary_x3", "Get statistic salary x3 with specific date,date must be formated in dd/mm/yyy or dd-mm-yyyy", {
50
- date: zod_1.default.string({
51
- description: "Date to statistic with format dd/mm/yyy or dd-mm-yyyy",
52
- }),
53
- }, (args) => __awaiter(void 0, void 0, void 0, function* () {
54
- return (0, tools_1.statisticX3Tool)({
55
- date: args.date,
56
- sendMessageToLark: (0, env_1.getEnv)().SEND_MESSAGE_TO_LARK === "true",
57
- });
58
- }));
59
- exports.server.tool("statistic_salary_x3_in_range", "Get statistic salary x3 with range of date,date must be formated in dd/mm/yyy or dd-mm-yyyy", {
60
- start_date: zod_1.default.string({
61
- description: "Start date to statistic with format dd/mm/yyy or dd-mm-yyyy",
62
- }),
63
- end_date: zod_1.default.string({
64
- description: "End date to statistic with format dd/mm/yyy or dd-mm-yyyy",
65
- }),
66
- }, (args) => __awaiter(void 0, void 0, void 0, function* () {
67
- return (0, tools_1.statisticX3RangeTool)({
68
- startDateStr: args.start_date,
69
- endDateStr: args.end_date,
70
- sendMessageToLark: (0, env_1.getEnv)().SEND_MESSAGE_TO_LARK === "true",
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: zod_1.default.object({
81
- company_name: zod_1.default.string({ description: "Company name to get data" }),
82
- year: zod_1.default
83
- .string({
84
- description: "Year to get company debt collection,if year is not provided use this year (vietname time zone)",
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: zod_1.default
89
- .string({
90
- description: "Product type to get data one of follow values EWA 02 - 03 | EWA 04 | Lương X3 | Lương X3 - EVF ",
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
- exports.server.tool("debt_collection_with_month", "The company's debt collection information with month", {
104
- month: zod_1.default
105
- .string()
106
- .describe("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"),
107
- company_name: zod_1.default.string({ description: "Company name to get data" }),
108
- }, (args) => __awaiter(void 0, void 0, void 0, function* () {
109
- const { month, company_name } = args;
110
- return (0, lark_tool_1.debtCollectionRateTool)({
111
- sendMessageToLark: (0, env_1.getEnv)().SEND_MESSAGE_TO_LARK === "true",
112
- monthDate: month,
113
- companyName: company_name,
114
- productType: product_type_1.PRODUCT_TYPE.EWA_02_03,
115
- });
116
- }));
117
- exports.server.tool("debt_collection_ewa_02", "The company's debt collection information with EWA 02 - 03 product type", {
118
- company_name: zod_1.default.string({ description: "Company name to get data" }),
119
- }, (args) => __awaiter(void 0, void 0, void 0, function* () {
120
- const { company_name } = args;
121
- return (0, lark_tool_1.debtCollectionRateTool)({
122
- sendMessageToLark: (0, env_1.getEnv)().SEND_MESSAGE_TO_LARK === "true",
123
- companyName: company_name,
124
- productType: product_type_1.PRODUCT_TYPE.EWA_02_03,
125
- });
126
- }));
127
- exports.server.tool("debt_collection_ewa_04", "The company's debt collection information with EWA 04 product type", {
128
- company_name: zod_1.default.string({ description: "Company name to get data" }),
129
- }, (args) => __awaiter(void 0, void 0, void 0, function* () {
130
- const { company_name } = args;
131
- return (0, lark_tool_1.debtCollectionRateTool)({
132
- sendMessageToLark: (0, env_1.getEnv)().SEND_MESSAGE_TO_LARK === "true",
133
- companyName: company_name,
134
- productType: product_type_1.PRODUCT_TYPE.EWA_04,
135
- });
136
- }));
137
- exports.server.tool("debt_collection_x3", "The company's debt collection information with Lương X3 product type", {
138
- company_name: zod_1.default.string({ description: "Company name to get data" }),
139
- }, (args) => __awaiter(void 0, void 0, void 0, function* () {
140
- const { company_name } = args;
141
- return (0, lark_tool_1.debtCollectionRateTool)({
142
- sendMessageToLark: (0, env_1.getEnv)().SEND_MESSAGE_TO_LARK === "true",
143
- companyName: company_name,
144
- productType: product_type_1.PRODUCT_TYPE.X3,
145
- });
146
- }));
147
- exports.server.tool("debt_collection_x3_evf", "The company's debt collection information with Lương X3 - EVF product type", {
148
- company_name: zod_1.default.string({ description: "Company name to get data" }),
149
- }, (args) => __awaiter(void 0, void 0, void 0, function* () {
150
- const { company_name } = args;
151
- return (0, lark_tool_1.debtCollectionRateTool)({
152
- sendMessageToLark: (0, env_1.getEnv)().SEND_MESSAGE_TO_LARK === "true",
153
- companyName: company_name,
154
- productType: product_type_1.PRODUCT_TYPE.X3_EVF,
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-mcp",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "Mcp server for Gm",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
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
- "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
- );
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({ description: "Company name to get data" }),
103
+ company_name: z.string().describe("Company name to get data"),
104
104
  year: z
105
- .string({
106
- description: "Year to get company debt collection,if year is not provided use this year (vietname time zone)",
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
- description:
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
- "debt_collection_with_month",
131
- "The company's debt collection information with month",
132
- {
133
- month: z
134
- .string()
135
- .describe(
136
- "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"
137
- ),
138
- company_name: z.string({ description: "Company name to get data" }),
139
- },
140
- async (args) => {
141
- const { month, company_name } = args;
142
- return debtCollectionRateTool({
143
- sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
144
- monthDate: month,
145
- companyName: company_name,
146
- productType: PRODUCT_TYPE.EWA_02_03,
147
- });
148
- }
149
- );
150
-
151
- server.tool(
152
- "debt_collection_ewa_02",
153
- "The company's debt collection information with EWA 02 - 03 product type",
154
- {
155
- company_name: z.string({ description: "Company name to get data" }),
156
- },
157
- async (args) => {
158
- const { company_name } = args;
159
- return debtCollectionRateTool({
160
- sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
161
- companyName: company_name,
162
- productType: PRODUCT_TYPE.EWA_02_03,
163
- });
164
- }
165
- );
166
-
167
- server.tool(
168
- "debt_collection_ewa_04",
169
- "The company's debt collection information with EWA 04 product type",
170
- {
171
- company_name: z.string({ description: "Company name to get data" }),
172
- },
173
- async (args) => {
174
- const { company_name } = args;
175
- return debtCollectionRateTool({
176
- sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
177
- companyName: company_name,
178
- productType: PRODUCT_TYPE.EWA_04,
179
- });
180
- }
181
- );
182
-
183
- server.tool(
184
- "debt_collection_x3",
185
- "The company's debt collection information with Lương X3 product type",
186
- {
187
- company_name: z.string({ description: "Company name to get data" }),
188
- },
189
- async (args) => {
190
- const { company_name } = args;
191
- return debtCollectionRateTool({
192
- sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
193
- companyName: company_name,
194
- productType: PRODUCT_TYPE.X3,
195
- });
196
- }
197
- );
198
-
199
- server.tool(
200
- "debt_collection_x3_evf",
201
- "The company's debt collection information with Lương X3 - EVF product type",
202
- {
203
- company_name: z.string({ description: "Company name to get data" }),
204
- },
205
- async (args) => {
206
- const { company_name } = args;
207
- return debtCollectionRateTool({
208
- sendMessageToLark: getEnv().SEND_MESSAGE_TO_LARK === "true",
209
- companyName: company_name,
210
- productType: PRODUCT_TYPE.X3_EVF,
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();