@sargonpiraev/hh-mcp-server 1.9.0 → 1.10.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.
Files changed (2) hide show
  1. package/build/index.js +71 -67
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -46,6 +46,16 @@ apiClient.interceptors.request.use((config) => {
46
46
  }, (error) => {
47
47
  return Promise.reject(error);
48
48
  });
49
+ function handleResult(data) {
50
+ return {
51
+ content: [
52
+ {
53
+ type: 'text',
54
+ text: JSON.stringify(data, null, 2),
55
+ },
56
+ ],
57
+ };
58
+ }
49
59
  function handleError(error) {
50
60
  console.error(error);
51
61
  logger.error('Error occurred:', JSON.stringify(error));
@@ -62,19 +72,52 @@ function handleError(error) {
62
72
  };
63
73
  }
64
74
  // Tools
65
- mcpServer.tool('get-vacancies', `Search for vacancies`, {}, async (args) => {
75
+ mcpServer.tool('get-vacancies', `Search for vacancies`, {
76
+ page: z.number().optional(),
77
+ per_page: z.number().optional(),
78
+ text: z.string().optional(),
79
+ search_field: z.string().optional(),
80
+ experience: z.string().optional(),
81
+ employment: z.string().optional(),
82
+ schedule: z.string().optional(),
83
+ area: z.string().optional(),
84
+ metro: z.string().optional(),
85
+ professional_role: z.string().optional(),
86
+ industry: z.string().optional(),
87
+ employer_id: z.string().optional(),
88
+ currency: z.string().optional(),
89
+ salary: z.number().optional(),
90
+ label: z.string().optional(),
91
+ only_with_salary: z.boolean().optional(),
92
+ period: z.number().optional(),
93
+ date_from: z.string().optional(),
94
+ date_to: z.string().optional(),
95
+ top_lat: z.number().optional(),
96
+ bottom_lat: z.number().optional(),
97
+ left_lng: z.number().optional(),
98
+ right_lng: z.number().optional(),
99
+ order_by: z.string().optional(),
100
+ sort_point_lat: z.number().optional(),
101
+ sort_point_lng: z.number().optional(),
102
+ clusters: z.boolean().optional(),
103
+ describe_arguments: z.boolean().optional(),
104
+ no_magic: z.boolean().optional(),
105
+ premium: z.boolean().optional(),
106
+ responses_count_enabled: z.boolean().optional(),
107
+ part_time: z.string().optional(),
108
+ accept_temporary: z.boolean().optional(),
109
+ employment_form: z.string().optional(),
110
+ work_schedule_by_days: z.string().optional(),
111
+ working_hours: z.string().optional(),
112
+ work_format: z.string().optional(),
113
+ excluded_text: z.string().optional(),
114
+ education: z.string().optional(),
115
+ }, async (args) => {
66
116
  try {
67
117
  const response = await apiClient.get('/vacancies', {
68
118
  params: args,
69
119
  });
70
- return {
71
- content: [
72
- {
73
- type: 'text',
74
- text: JSON.stringify(response.data, null, 2),
75
- },
76
- ],
77
- };
120
+ return handleResult(response.data);
78
121
  }
79
122
  catch (error) {
80
123
  return handleError(error);
@@ -85,32 +128,20 @@ mcpServer.tool('get-dictionaries', `Directories of fields`, {}, async (args) =>
85
128
  const response = await apiClient.get('/dictionaries', {
86
129
  params: args,
87
130
  });
88
- return {
89
- content: [
90
- {
91
- type: 'text',
92
- text: JSON.stringify(response.data, null, 2),
93
- },
94
- ],
95
- };
131
+ return handleResult(response.data);
96
132
  }
97
133
  catch (error) {
98
134
  return handleError(error);
99
135
  }
100
136
  });
101
- mcpServer.tool('get-areas', `Tree view of all regions`, {}, async (args) => {
137
+ mcpServer.tool('get-areas', `Tree view of all regions`, {
138
+ additional_case: z.string().optional(),
139
+ }, async (args) => {
102
140
  try {
103
141
  const response = await apiClient.get('/areas', {
104
142
  params: args,
105
143
  });
106
- return {
107
- content: [
108
- {
109
- type: 'text',
110
- text: JSON.stringify(response.data, null, 2),
111
- },
112
- ],
113
- };
144
+ return handleResult(response.data);
114
145
  }
115
146
  catch (error) {
116
147
  return handleError(error);
@@ -121,14 +152,7 @@ mcpServer.tool('get-languages', `The list of all languages`, {}, async (args) =>
121
152
  const response = await apiClient.get('/languages', {
122
153
  params: args,
123
154
  });
124
- return {
125
- content: [
126
- {
127
- type: 'text',
128
- text: JSON.stringify(response.data, null, 2),
129
- },
130
- ],
131
- };
155
+ return handleResult(response.data);
132
156
  }
133
157
  catch (error) {
134
158
  return handleError(error);
@@ -139,14 +163,7 @@ mcpServer.tool('get-industries', `Industries`, {}, async (args) => {
139
163
  const response = await apiClient.get('/industries', {
140
164
  params: args,
141
165
  });
142
- return {
143
- content: [
144
- {
145
- type: 'text',
146
- text: JSON.stringify(response.data, null, 2),
147
- },
148
- ],
149
- };
166
+ return handleResult(response.data);
150
167
  }
151
168
  catch (error) {
152
169
  return handleError(error);
@@ -157,14 +174,7 @@ mcpServer.tool('get-metro', `The list of metro stations in all cities`, {}, asyn
157
174
  const response = await apiClient.get('/metro', {
158
175
  params: args,
159
176
  });
160
- return {
161
- content: [
162
- {
163
- type: 'text',
164
- text: JSON.stringify(response.data, null, 2),
165
- },
166
- ],
167
- };
177
+ return handleResult(response.data);
168
178
  }
169
179
  catch (error) {
170
180
  return handleError(error);
@@ -175,32 +185,26 @@ mcpServer.tool('get-professional-roles', `Professional role directory`, {}, asyn
175
185
  const response = await apiClient.get('/professional_roles', {
176
186
  params: args,
177
187
  });
178
- return {
179
- content: [
180
- {
181
- type: 'text',
182
- text: JSON.stringify(response.data, null, 2),
183
- },
184
- ],
185
- };
188
+ return handleResult(response.data);
186
189
  }
187
190
  catch (error) {
188
191
  return handleError(error);
189
192
  }
190
193
  });
191
- mcpServer.tool('get-employers', `Employer search`, {}, async (args) => {
194
+ mcpServer.tool('get-employers', `Employer search`, {
195
+ text: z.string().optional(),
196
+ area: z.string().optional(),
197
+ type: z.string().optional(),
198
+ only_with_vacancies: z.boolean().optional(),
199
+ sort_by: z.enum(['by_name', 'by_vacancies_open']).optional(),
200
+ page: z.number().optional(),
201
+ per_page: z.number().optional(),
202
+ }, async (args) => {
192
203
  try {
193
204
  const response = await apiClient.get('/employers', {
194
205
  params: args,
195
206
  });
196
- return {
197
- content: [
198
- {
199
- type: 'text',
200
- text: JSON.stringify(response.data, null, 2),
201
- },
202
- ],
203
- };
207
+ return handleResult(response.data);
204
208
  }
205
209
  catch (error) {
206
210
  return handleError(error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sargonpiraev/hh-mcp-server",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "MCP Server for HeadHunter API - job search and vacancy management",
5
5
  "keywords": [
6
6
  "mcp",