@owine/unifi-network-mcp 2.0.1 → 2.0.2
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/tools/acl.js +107 -79
- package/dist/tools/clients.js +75 -59
- package/dist/tools/devices.js +95 -63
- package/dist/tools/dns-policies.js +77 -57
- package/dist/tools/firewall.js +200 -148
- package/dist/tools/hotspot.js +123 -103
- package/dist/tools/networks.js +106 -82
- package/dist/tools/sites.js +23 -19
- package/dist/tools/supporting.js +185 -153
- package/dist/tools/system.js +5 -1
- package/dist/tools/traffic-matching.js +83 -63
- package/dist/tools/wifi.js +84 -64
- package/package.json +4 -4
package/dist/tools/supporting.js
CHANGED
|
@@ -6,22 +6,26 @@ const responses_js_1 = require("../utils/responses.js");
|
|
|
6
6
|
const query_js_1 = require("../utils/query.js");
|
|
7
7
|
const safety_js_1 = require("../utils/safety.js");
|
|
8
8
|
function registerSupportingTools(server, client) {
|
|
9
|
-
server.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
.
|
|
13
|
-
.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
server.registerTool("unifi_list_wans", {
|
|
10
|
+
description: "List all WAN interfaces at a site",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
siteId: zod_1.z.string().describe("Site ID"),
|
|
13
|
+
offset: zod_1.z
|
|
14
|
+
.number()
|
|
15
|
+
.int()
|
|
16
|
+
.nonnegative()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Number of records to skip (default: 0)"),
|
|
19
|
+
limit: zod_1.z
|
|
20
|
+
.number()
|
|
21
|
+
.int()
|
|
22
|
+
.min(1)
|
|
23
|
+
.max(200)
|
|
24
|
+
.optional()
|
|
25
|
+
.describe("Number of records to return (default: 25, max: 200)"),
|
|
26
|
+
},
|
|
27
|
+
annotations: safety_js_1.READ_ONLY,
|
|
28
|
+
}, async ({ siteId, offset, limit }) => {
|
|
25
29
|
try {
|
|
26
30
|
const query = (0, query_js_1.buildQuery)({ offset, limit });
|
|
27
31
|
const data = await client.get(`/sites/${siteId}/wans${query}`);
|
|
@@ -31,26 +35,30 @@ function registerSupportingTools(server, client) {
|
|
|
31
35
|
return (0, responses_js_1.formatError)(err);
|
|
32
36
|
}
|
|
33
37
|
});
|
|
34
|
-
server.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
.
|
|
38
|
-
.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
.
|
|
52
|
-
|
|
53
|
-
|
|
38
|
+
server.registerTool("unifi_list_vpn_tunnels", {
|
|
39
|
+
description: "List all site-to-site VPN tunnels at a site",
|
|
40
|
+
inputSchema: {
|
|
41
|
+
siteId: zod_1.z.string().describe("Site ID"),
|
|
42
|
+
offset: zod_1.z
|
|
43
|
+
.number()
|
|
44
|
+
.int()
|
|
45
|
+
.nonnegative()
|
|
46
|
+
.optional()
|
|
47
|
+
.describe("Number of records to skip (default: 0)"),
|
|
48
|
+
limit: zod_1.z
|
|
49
|
+
.number()
|
|
50
|
+
.int()
|
|
51
|
+
.min(1)
|
|
52
|
+
.max(200)
|
|
53
|
+
.optional()
|
|
54
|
+
.describe("Number of records to return (default: 25, max: 200)"),
|
|
55
|
+
filter: zod_1.z
|
|
56
|
+
.string()
|
|
57
|
+
.optional()
|
|
58
|
+
.describe("Filter expression"),
|
|
59
|
+
},
|
|
60
|
+
annotations: safety_js_1.READ_ONLY,
|
|
61
|
+
}, async ({ siteId, offset, limit, filter }) => {
|
|
54
62
|
try {
|
|
55
63
|
const query = (0, query_js_1.buildQuery)({ offset, limit, filter });
|
|
56
64
|
const data = await client.get(`/sites/${siteId}/vpn/site-to-site-tunnels${query}`);
|
|
@@ -60,26 +68,30 @@ function registerSupportingTools(server, client) {
|
|
|
60
68
|
return (0, responses_js_1.formatError)(err);
|
|
61
69
|
}
|
|
62
70
|
});
|
|
63
|
-
server.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
.
|
|
67
|
-
.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
.
|
|
81
|
-
|
|
82
|
-
|
|
71
|
+
server.registerTool("unifi_list_vpn_servers", {
|
|
72
|
+
description: "List all VPN servers at a site",
|
|
73
|
+
inputSchema: {
|
|
74
|
+
siteId: zod_1.z.string().describe("Site ID"),
|
|
75
|
+
offset: zod_1.z
|
|
76
|
+
.number()
|
|
77
|
+
.int()
|
|
78
|
+
.nonnegative()
|
|
79
|
+
.optional()
|
|
80
|
+
.describe("Number of records to skip (default: 0)"),
|
|
81
|
+
limit: zod_1.z
|
|
82
|
+
.number()
|
|
83
|
+
.int()
|
|
84
|
+
.min(1)
|
|
85
|
+
.max(200)
|
|
86
|
+
.optional()
|
|
87
|
+
.describe("Number of records to return (default: 25, max: 200)"),
|
|
88
|
+
filter: zod_1.z
|
|
89
|
+
.string()
|
|
90
|
+
.optional()
|
|
91
|
+
.describe("Filter expression"),
|
|
92
|
+
},
|
|
93
|
+
annotations: safety_js_1.READ_ONLY,
|
|
94
|
+
}, async ({ siteId, offset, limit, filter }) => {
|
|
83
95
|
try {
|
|
84
96
|
const query = (0, query_js_1.buildQuery)({ offset, limit, filter });
|
|
85
97
|
const data = await client.get(`/sites/${siteId}/vpn/servers${query}`);
|
|
@@ -89,26 +101,30 @@ function registerSupportingTools(server, client) {
|
|
|
89
101
|
return (0, responses_js_1.formatError)(err);
|
|
90
102
|
}
|
|
91
103
|
});
|
|
92
|
-
server.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
.
|
|
96
|
-
.
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
.
|
|
110
|
-
|
|
111
|
-
|
|
104
|
+
server.registerTool("unifi_list_radius_profiles", {
|
|
105
|
+
description: "List all RADIUS profiles at a site",
|
|
106
|
+
inputSchema: {
|
|
107
|
+
siteId: zod_1.z.string().describe("Site ID"),
|
|
108
|
+
offset: zod_1.z
|
|
109
|
+
.number()
|
|
110
|
+
.int()
|
|
111
|
+
.nonnegative()
|
|
112
|
+
.optional()
|
|
113
|
+
.describe("Number of records to skip (default: 0)"),
|
|
114
|
+
limit: zod_1.z
|
|
115
|
+
.number()
|
|
116
|
+
.int()
|
|
117
|
+
.min(1)
|
|
118
|
+
.max(200)
|
|
119
|
+
.optional()
|
|
120
|
+
.describe("Number of records to return (default: 25, max: 200)"),
|
|
121
|
+
filter: zod_1.z
|
|
122
|
+
.string()
|
|
123
|
+
.optional()
|
|
124
|
+
.describe("Filter expression"),
|
|
125
|
+
},
|
|
126
|
+
annotations: safety_js_1.READ_ONLY,
|
|
127
|
+
}, async ({ siteId, offset, limit, filter }) => {
|
|
112
128
|
try {
|
|
113
129
|
const query = (0, query_js_1.buildQuery)({ offset, limit, filter });
|
|
114
130
|
const data = await client.get(`/sites/${siteId}/radius/profiles${query}`);
|
|
@@ -118,26 +134,30 @@ function registerSupportingTools(server, client) {
|
|
|
118
134
|
return (0, responses_js_1.formatError)(err);
|
|
119
135
|
}
|
|
120
136
|
});
|
|
121
|
-
server.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
.
|
|
125
|
-
.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
.
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
server.registerTool("unifi_list_device_tags", {
|
|
138
|
+
description: "List all device tags at a site (used for WiFi broadcast assignments)",
|
|
139
|
+
inputSchema: {
|
|
140
|
+
siteId: zod_1.z.string().describe("Site ID"),
|
|
141
|
+
offset: zod_1.z
|
|
142
|
+
.number()
|
|
143
|
+
.int()
|
|
144
|
+
.nonnegative()
|
|
145
|
+
.optional()
|
|
146
|
+
.describe("Number of records to skip (default: 0)"),
|
|
147
|
+
limit: zod_1.z
|
|
148
|
+
.number()
|
|
149
|
+
.int()
|
|
150
|
+
.min(1)
|
|
151
|
+
.max(200)
|
|
152
|
+
.optional()
|
|
153
|
+
.describe("Number of records to return (default: 25, max: 200)"),
|
|
154
|
+
filter: zod_1.z
|
|
155
|
+
.string()
|
|
156
|
+
.optional()
|
|
157
|
+
.describe("Filter expression"),
|
|
158
|
+
},
|
|
159
|
+
annotations: safety_js_1.READ_ONLY,
|
|
160
|
+
}, async ({ siteId, offset, limit, filter }) => {
|
|
141
161
|
try {
|
|
142
162
|
const query = (0, query_js_1.buildQuery)({ offset, limit, filter });
|
|
143
163
|
const data = await client.get(`/sites/${siteId}/device-tags${query}`);
|
|
@@ -147,25 +167,29 @@ function registerSupportingTools(server, client) {
|
|
|
147
167
|
return (0, responses_js_1.formatError)(err);
|
|
148
168
|
}
|
|
149
169
|
});
|
|
150
|
-
server.
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
.
|
|
167
|
-
|
|
168
|
-
|
|
170
|
+
server.registerTool("unifi_list_dpi_categories", {
|
|
171
|
+
description: "List all DPI (Deep Packet Inspection) categories for traffic identification",
|
|
172
|
+
inputSchema: {
|
|
173
|
+
offset: zod_1.z
|
|
174
|
+
.number()
|
|
175
|
+
.int()
|
|
176
|
+
.nonnegative()
|
|
177
|
+
.optional()
|
|
178
|
+
.describe("Number of records to skip (default: 0)"),
|
|
179
|
+
limit: zod_1.z
|
|
180
|
+
.number()
|
|
181
|
+
.int()
|
|
182
|
+
.min(1)
|
|
183
|
+
.max(200)
|
|
184
|
+
.optional()
|
|
185
|
+
.describe("Number of records to return (default: 25, max: 200)"),
|
|
186
|
+
filter: zod_1.z
|
|
187
|
+
.string()
|
|
188
|
+
.optional()
|
|
189
|
+
.describe("Filter expression"),
|
|
190
|
+
},
|
|
191
|
+
annotations: safety_js_1.READ_ONLY,
|
|
192
|
+
}, async ({ offset, limit, filter }) => {
|
|
169
193
|
try {
|
|
170
194
|
const query = (0, query_js_1.buildQuery)({ offset, limit, filter });
|
|
171
195
|
const data = await client.get(`/dpi/categories${query}`);
|
|
@@ -175,25 +199,29 @@ function registerSupportingTools(server, client) {
|
|
|
175
199
|
return (0, responses_js_1.formatError)(err);
|
|
176
200
|
}
|
|
177
201
|
});
|
|
178
|
-
server.
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
.
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
.
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
.
|
|
195
|
-
|
|
196
|
-
|
|
202
|
+
server.registerTool("unifi_list_dpi_applications", {
|
|
203
|
+
description: "List all DPI applications for traffic identification and filtering",
|
|
204
|
+
inputSchema: {
|
|
205
|
+
offset: zod_1.z
|
|
206
|
+
.number()
|
|
207
|
+
.int()
|
|
208
|
+
.nonnegative()
|
|
209
|
+
.optional()
|
|
210
|
+
.describe("Number of records to skip (default: 0)"),
|
|
211
|
+
limit: zod_1.z
|
|
212
|
+
.number()
|
|
213
|
+
.int()
|
|
214
|
+
.min(1)
|
|
215
|
+
.max(200)
|
|
216
|
+
.optional()
|
|
217
|
+
.describe("Number of records to return (default: 25, max: 200)"),
|
|
218
|
+
filter: zod_1.z
|
|
219
|
+
.string()
|
|
220
|
+
.optional()
|
|
221
|
+
.describe("Filter expression"),
|
|
222
|
+
},
|
|
223
|
+
annotations: safety_js_1.READ_ONLY,
|
|
224
|
+
}, async ({ offset, limit, filter }) => {
|
|
197
225
|
try {
|
|
198
226
|
const query = (0, query_js_1.buildQuery)({ offset, limit, filter });
|
|
199
227
|
const data = await client.get(`/dpi/applications${query}`);
|
|
@@ -203,25 +231,29 @@ function registerSupportingTools(server, client) {
|
|
|
203
231
|
return (0, responses_js_1.formatError)(err);
|
|
204
232
|
}
|
|
205
233
|
});
|
|
206
|
-
server.
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
.
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
.
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
.
|
|
223
|
-
|
|
224
|
-
|
|
234
|
+
server.registerTool("unifi_list_countries", {
|
|
235
|
+
description: "List all countries/regions for geo-based rules (ISO codes and names)",
|
|
236
|
+
inputSchema: {
|
|
237
|
+
offset: zod_1.z
|
|
238
|
+
.number()
|
|
239
|
+
.int()
|
|
240
|
+
.nonnegative()
|
|
241
|
+
.optional()
|
|
242
|
+
.describe("Number of records to skip (default: 0)"),
|
|
243
|
+
limit: zod_1.z
|
|
244
|
+
.number()
|
|
245
|
+
.int()
|
|
246
|
+
.min(1)
|
|
247
|
+
.max(200)
|
|
248
|
+
.optional()
|
|
249
|
+
.describe("Number of records to return (default: 25, max: 200)"),
|
|
250
|
+
filter: zod_1.z
|
|
251
|
+
.string()
|
|
252
|
+
.optional()
|
|
253
|
+
.describe("Filter expression (e.g., 'name.like(United*)')"),
|
|
254
|
+
},
|
|
255
|
+
annotations: safety_js_1.READ_ONLY,
|
|
256
|
+
}, async ({ offset, limit, filter }) => {
|
|
225
257
|
try {
|
|
226
258
|
const query = (0, query_js_1.buildQuery)({ offset, limit, filter });
|
|
227
259
|
const data = await client.get(`/countries${query}`);
|
package/dist/tools/system.js
CHANGED
|
@@ -4,7 +4,11 @@ exports.registerSystemTools = registerSystemTools;
|
|
|
4
4
|
const responses_js_1 = require("../utils/responses.js");
|
|
5
5
|
const safety_js_1 = require("../utils/safety.js");
|
|
6
6
|
function registerSystemTools(server, client) {
|
|
7
|
-
server.
|
|
7
|
+
server.registerTool("unifi_get_info", {
|
|
8
|
+
description: "Get application information including version and whether it's a UniFi OS Console",
|
|
9
|
+
inputSchema: {},
|
|
10
|
+
annotations: safety_js_1.READ_ONLY,
|
|
11
|
+
}, async () => {
|
|
8
12
|
try {
|
|
9
13
|
const data = await client.get("/info");
|
|
10
14
|
return (0, responses_js_1.formatSuccess)(data);
|
|
@@ -6,26 +6,30 @@ const responses_js_1 = require("../utils/responses.js");
|
|
|
6
6
|
const query_js_1 = require("../utils/query.js");
|
|
7
7
|
const safety_js_1 = require("../utils/safety.js");
|
|
8
8
|
function registerTrafficMatchingTools(server, client, readOnly = false) {
|
|
9
|
-
server.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
.
|
|
13
|
-
.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
.
|
|
27
|
-
|
|
28
|
-
|
|
9
|
+
server.registerTool("unifi_list_traffic_matching_lists", {
|
|
10
|
+
description: "List all traffic matching lists at a site (port groups, IP groups)",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
siteId: zod_1.z.string().describe("Site ID"),
|
|
13
|
+
offset: zod_1.z
|
|
14
|
+
.number()
|
|
15
|
+
.int()
|
|
16
|
+
.nonnegative()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Number of records to skip (default: 0)"),
|
|
19
|
+
limit: zod_1.z
|
|
20
|
+
.number()
|
|
21
|
+
.int()
|
|
22
|
+
.min(1)
|
|
23
|
+
.max(200)
|
|
24
|
+
.optional()
|
|
25
|
+
.describe("Number of records to return (default: 25, max: 200)"),
|
|
26
|
+
filter: zod_1.z
|
|
27
|
+
.string()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe("Filter expression"),
|
|
30
|
+
},
|
|
31
|
+
annotations: safety_js_1.READ_ONLY,
|
|
32
|
+
}, async ({ siteId, offset, limit, filter }) => {
|
|
29
33
|
try {
|
|
30
34
|
const query = (0, query_js_1.buildQuery)({ offset, limit, filter });
|
|
31
35
|
const data = await client.get(`/sites/${siteId}/traffic-matching-lists${query}`);
|
|
@@ -35,10 +39,14 @@ function registerTrafficMatchingTools(server, client, readOnly = false) {
|
|
|
35
39
|
return (0, responses_js_1.formatError)(err);
|
|
36
40
|
}
|
|
37
41
|
});
|
|
38
|
-
server.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
server.registerTool("unifi_get_traffic_matching_list", {
|
|
43
|
+
description: "Get a specific traffic matching list by ID",
|
|
44
|
+
inputSchema: {
|
|
45
|
+
siteId: zod_1.z.string().describe("Site ID"),
|
|
46
|
+
trafficMatchingListId: zod_1.z.string().describe("Traffic matching list ID"),
|
|
47
|
+
},
|
|
48
|
+
annotations: safety_js_1.READ_ONLY,
|
|
49
|
+
}, async ({ siteId, trafficMatchingListId }) => {
|
|
42
50
|
try {
|
|
43
51
|
const data = await client.get(`/sites/${siteId}/traffic-matching-lists/${trafficMatchingListId}`);
|
|
44
52
|
return (0, responses_js_1.formatSuccess)(data);
|
|
@@ -49,20 +57,24 @@ function registerTrafficMatchingTools(server, client, readOnly = false) {
|
|
|
49
57
|
});
|
|
50
58
|
if (readOnly)
|
|
51
59
|
return;
|
|
52
|
-
server.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
.
|
|
56
|
-
.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
.
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
server.registerTool("unifi_create_traffic_matching_list", {
|
|
61
|
+
description: "Create a new traffic matching list",
|
|
62
|
+
inputSchema: {
|
|
63
|
+
siteId: zod_1.z.string().describe("Site ID"),
|
|
64
|
+
type: zod_1.z
|
|
65
|
+
.enum(["PORTS", "IPV4_ADDRESSES", "IPV6_ADDRESSES"])
|
|
66
|
+
.describe("List type"),
|
|
67
|
+
name: zod_1.z.string().describe("List name"),
|
|
68
|
+
items: zod_1.z
|
|
69
|
+
.array(zod_1.z.unknown())
|
|
70
|
+
.describe("List items (ports or IP addresses)"),
|
|
71
|
+
dryRun: zod_1.z
|
|
72
|
+
.boolean()
|
|
73
|
+
.optional()
|
|
74
|
+
.describe("Preview this action without executing it"),
|
|
75
|
+
},
|
|
76
|
+
annotations: safety_js_1.WRITE_NOT_IDEMPOTENT,
|
|
77
|
+
}, async ({ siteId, type, name, items, dryRun }) => {
|
|
66
78
|
try {
|
|
67
79
|
const body = { type, name, items };
|
|
68
80
|
if (dryRun)
|
|
@@ -74,19 +86,23 @@ function registerTrafficMatchingTools(server, client, readOnly = false) {
|
|
|
74
86
|
return (0, responses_js_1.formatError)(err);
|
|
75
87
|
}
|
|
76
88
|
});
|
|
77
|
-
server.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
.
|
|
82
|
-
.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
.
|
|
87
|
-
.
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
server.registerTool("unifi_update_traffic_matching_list", {
|
|
90
|
+
description: "Update a traffic matching list",
|
|
91
|
+
inputSchema: {
|
|
92
|
+
siteId: zod_1.z.string().describe("Site ID"),
|
|
93
|
+
trafficMatchingListId: zod_1.z.string().describe("Traffic matching list ID"),
|
|
94
|
+
type: zod_1.z
|
|
95
|
+
.enum(["PORTS", "IPV4_ADDRESSES", "IPV6_ADDRESSES"])
|
|
96
|
+
.describe("List type"),
|
|
97
|
+
name: zod_1.z.string().describe("List name"),
|
|
98
|
+
items: zod_1.z.array(zod_1.z.unknown()).describe("List items"),
|
|
99
|
+
dryRun: zod_1.z
|
|
100
|
+
.boolean()
|
|
101
|
+
.optional()
|
|
102
|
+
.describe("Preview this action without executing it"),
|
|
103
|
+
},
|
|
104
|
+
annotations: safety_js_1.WRITE,
|
|
105
|
+
}, async ({ siteId, trafficMatchingListId, type, name, items, dryRun }) => {
|
|
90
106
|
try {
|
|
91
107
|
const body = { type, name, items };
|
|
92
108
|
if (dryRun)
|
|
@@ -98,18 +114,22 @@ function registerTrafficMatchingTools(server, client, readOnly = false) {
|
|
|
98
114
|
return (0, responses_js_1.formatError)(err);
|
|
99
115
|
}
|
|
100
116
|
});
|
|
101
|
-
server.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
.
|
|
106
|
-
.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
.
|
|
111
|
-
|
|
112
|
-
|
|
117
|
+
server.registerTool("unifi_delete_traffic_matching_list", {
|
|
118
|
+
description: "DESTRUCTIVE: Delete a traffic matching list",
|
|
119
|
+
inputSchema: {
|
|
120
|
+
siteId: zod_1.z.string().describe("Site ID"),
|
|
121
|
+
trafficMatchingListId: zod_1.z.string().describe("Traffic matching list ID"),
|
|
122
|
+
confirm: zod_1.z
|
|
123
|
+
.boolean()
|
|
124
|
+
.optional()
|
|
125
|
+
.describe("Must be true to execute this destructive action"),
|
|
126
|
+
dryRun: zod_1.z
|
|
127
|
+
.boolean()
|
|
128
|
+
.optional()
|
|
129
|
+
.describe("Preview this action without executing it"),
|
|
130
|
+
},
|
|
131
|
+
annotations: safety_js_1.DESTRUCTIVE,
|
|
132
|
+
}, async ({ siteId, trafficMatchingListId, confirm, dryRun }) => {
|
|
113
133
|
const guard = (0, safety_js_1.requireConfirmation)(confirm, "This will delete the traffic matching list");
|
|
114
134
|
if (guard)
|
|
115
135
|
return guard;
|