@owine/unifi-protect-mcp 2.6.0 → 2.7.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/README.md +1 -1
- package/dist/schemas/cameras.d.ts +137 -0
- package/dist/schemas/cameras.js +69 -0
- package/dist/schemas/common.d.ts +38 -0
- package/dist/schemas/common.js +55 -0
- package/dist/schemas/devices.d.ts +172 -0
- package/dist/schemas/devices.js +60 -0
- package/dist/schemas/misc.d.ts +184 -0
- package/dist/schemas/misc.js +108 -0
- package/dist/tools/arm-profiles.js +5 -1
- package/dist/tools/cameras.js +11 -4
- package/dist/tools/devices.d.ts +1 -0
- package/dist/tools/devices.js +18 -2
- package/dist/tools/files.js +3 -1
- package/dist/tools/liveviews.js +7 -2
- package/dist/tools/subscriptions.js +5 -2
- package/dist/tools/system.js +5 -2
- package/dist/tools/users.js +9 -4
- package/dist/utils/responses.d.ts +1 -0
- package/dist/utils/responses.js +7 -0
- package/dist/utils/safety.d.ts +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Schemas below are verified against live UniFi Protect Integration API 7.1.60
|
|
4
|
+
* responses (Melrose NVR Pro console, 2026-05-15). The Integration API surface
|
|
5
|
+
* is much thinner than the internal Protect app API — only the fields observed
|
|
6
|
+
* in real responses are typed; `.passthrough()` still allows anything extra a
|
|
7
|
+
* different firmware/hardware mix might add.
|
|
8
|
+
*/
|
|
9
|
+
export declare const infoOutputSchema: {
|
|
10
|
+
applicationVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
11
|
+
};
|
|
12
|
+
export declare const nvrSchema: z.ZodObject<{
|
|
13
|
+
id: z.ZodOptional<z.ZodString>;
|
|
14
|
+
modelKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
15
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16
|
+
doorbellSettings: z.ZodOptional<z.ZodObject<{
|
|
17
|
+
defaultMessageText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
|
+
defaultMessageResetTimeoutMs: z.ZodOptional<z.ZodUnknown>;
|
|
19
|
+
customMessages: z.ZodOptional<z.ZodUnknown>;
|
|
20
|
+
customImages: z.ZodOptional<z.ZodUnknown>;
|
|
21
|
+
}, z.core.$loose>>;
|
|
22
|
+
armMode: z.ZodOptional<z.ZodObject<{
|
|
23
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
|
+
armedAt: z.ZodOptional<z.ZodUnknown>;
|
|
25
|
+
willBeArmedAt: z.ZodOptional<z.ZodUnknown>;
|
|
26
|
+
breachDetectedAt: z.ZodOptional<z.ZodUnknown>;
|
|
27
|
+
breachEventCount: z.ZodOptional<z.ZodUnknown>;
|
|
28
|
+
breachTriggerEventId: z.ZodOptional<z.ZodUnknown>;
|
|
29
|
+
breachEventId: z.ZodOptional<z.ZodUnknown>;
|
|
30
|
+
}, z.core.$loose>>;
|
|
31
|
+
}, z.core.$loose>;
|
|
32
|
+
export declare const nvrOutputSchema: {
|
|
33
|
+
id: z.ZodOptional<z.ZodString>;
|
|
34
|
+
modelKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
36
|
+
doorbellSettings: z.ZodOptional<z.ZodObject<{
|
|
37
|
+
defaultMessageText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
38
|
+
defaultMessageResetTimeoutMs: z.ZodOptional<z.ZodUnknown>;
|
|
39
|
+
customMessages: z.ZodOptional<z.ZodUnknown>;
|
|
40
|
+
customImages: z.ZodOptional<z.ZodUnknown>;
|
|
41
|
+
}, z.core.$loose>>;
|
|
42
|
+
armMode: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
44
|
+
armedAt: z.ZodOptional<z.ZodUnknown>;
|
|
45
|
+
willBeArmedAt: z.ZodOptional<z.ZodUnknown>;
|
|
46
|
+
breachDetectedAt: z.ZodOptional<z.ZodUnknown>;
|
|
47
|
+
breachEventCount: z.ZodOptional<z.ZodUnknown>;
|
|
48
|
+
breachTriggerEventId: z.ZodOptional<z.ZodUnknown>;
|
|
49
|
+
breachEventId: z.ZodOptional<z.ZodUnknown>;
|
|
50
|
+
}, z.core.$loose>>;
|
|
51
|
+
};
|
|
52
|
+
export declare const userSchema: z.ZodObject<{
|
|
53
|
+
id: z.ZodOptional<z.ZodString>;
|
|
54
|
+
modelKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
55
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
|
+
firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
57
|
+
lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
58
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
|
+
ucoreUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
60
|
+
}, z.core.$loose>;
|
|
61
|
+
export declare const userOutputSchema: {
|
|
62
|
+
id: z.ZodOptional<z.ZodString>;
|
|
63
|
+
modelKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
64
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
65
|
+
firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
|
+
lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
68
|
+
ucoreUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
69
|
+
};
|
|
70
|
+
export declare const userListOutputSchema: {
|
|
71
|
+
result: z.ZodArray<z.ZodObject<{
|
|
72
|
+
id: z.ZodOptional<z.ZodString>;
|
|
73
|
+
modelKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
74
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
|
+
firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
76
|
+
lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
77
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
78
|
+
ucoreUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
79
|
+
}, z.core.$loose>>;
|
|
80
|
+
};
|
|
81
|
+
export declare const ulpUserSchema: z.ZodObject<{
|
|
82
|
+
id: z.ZodOptional<z.ZodString>;
|
|
83
|
+
modelKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
84
|
+
firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
85
|
+
lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
86
|
+
fullName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
87
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
88
|
+
}, z.core.$loose>;
|
|
89
|
+
export declare const ulpUserOutputSchema: {
|
|
90
|
+
id: z.ZodOptional<z.ZodString>;
|
|
91
|
+
modelKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
92
|
+
firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
93
|
+
lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
94
|
+
fullName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
95
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
96
|
+
};
|
|
97
|
+
export declare const ulpUserListOutputSchema: {
|
|
98
|
+
result: z.ZodArray<z.ZodObject<{
|
|
99
|
+
id: z.ZodOptional<z.ZodString>;
|
|
100
|
+
modelKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
101
|
+
firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
102
|
+
lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
103
|
+
fullName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
104
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
105
|
+
}, z.core.$loose>>;
|
|
106
|
+
};
|
|
107
|
+
export declare const liveviewSchema: z.ZodObject<{
|
|
108
|
+
id: z.ZodOptional<z.ZodString>;
|
|
109
|
+
modelKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
110
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
111
|
+
isDefault: z.ZodOptional<z.ZodUnknown>;
|
|
112
|
+
isGlobal: z.ZodOptional<z.ZodUnknown>;
|
|
113
|
+
layout: z.ZodOptional<z.ZodUnknown>;
|
|
114
|
+
owner: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
115
|
+
slots: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
116
|
+
cameras: z.ZodOptional<z.ZodUnknown>;
|
|
117
|
+
cycleMode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
118
|
+
cycleInterval: z.ZodOptional<z.ZodUnknown>;
|
|
119
|
+
}, z.core.$loose>>>;
|
|
120
|
+
}, z.core.$loose>;
|
|
121
|
+
export declare const liveviewOutputSchema: {
|
|
122
|
+
id: z.ZodOptional<z.ZodString>;
|
|
123
|
+
modelKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
124
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
125
|
+
isDefault: z.ZodOptional<z.ZodUnknown>;
|
|
126
|
+
isGlobal: z.ZodOptional<z.ZodUnknown>;
|
|
127
|
+
layout: z.ZodOptional<z.ZodUnknown>;
|
|
128
|
+
owner: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
129
|
+
slots: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
130
|
+
cameras: z.ZodOptional<z.ZodUnknown>;
|
|
131
|
+
cycleMode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
|
+
cycleInterval: z.ZodOptional<z.ZodUnknown>;
|
|
133
|
+
}, z.core.$loose>>>;
|
|
134
|
+
};
|
|
135
|
+
export declare const liveviewListOutputSchema: {
|
|
136
|
+
result: z.ZodArray<z.ZodObject<{
|
|
137
|
+
id: z.ZodOptional<z.ZodString>;
|
|
138
|
+
modelKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
139
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
140
|
+
isDefault: z.ZodOptional<z.ZodUnknown>;
|
|
141
|
+
isGlobal: z.ZodOptional<z.ZodUnknown>;
|
|
142
|
+
layout: z.ZodOptional<z.ZodUnknown>;
|
|
143
|
+
owner: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
144
|
+
slots: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
145
|
+
cameras: z.ZodOptional<z.ZodUnknown>;
|
|
146
|
+
cycleMode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
147
|
+
cycleInterval: z.ZodOptional<z.ZodUnknown>;
|
|
148
|
+
}, z.core.$loose>>>;
|
|
149
|
+
}, z.core.$loose>>;
|
|
150
|
+
};
|
|
151
|
+
export declare const armProfileSchema: z.ZodObject<{
|
|
152
|
+
id: z.ZodOptional<z.ZodString>;
|
|
153
|
+
modelKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
154
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
155
|
+
}, z.core.$loose>;
|
|
156
|
+
export declare const armProfileListOutputSchema: {
|
|
157
|
+
result: z.ZodArray<z.ZodObject<{
|
|
158
|
+
id: z.ZodOptional<z.ZodString>;
|
|
159
|
+
modelKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
160
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
161
|
+
}, z.core.$loose>>;
|
|
162
|
+
};
|
|
163
|
+
export declare const armProfileOutputSchema: {
|
|
164
|
+
id: z.ZodOptional<z.ZodString>;
|
|
165
|
+
modelKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
166
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
167
|
+
};
|
|
168
|
+
export declare const fileSchema: z.ZodObject<{
|
|
169
|
+
id: z.ZodOptional<z.ZodString>;
|
|
170
|
+
modelKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
171
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
172
|
+
}, z.core.$loose>;
|
|
173
|
+
export declare const fileListOutputSchema: {
|
|
174
|
+
result: z.ZodArray<z.ZodObject<{
|
|
175
|
+
id: z.ZodOptional<z.ZodString>;
|
|
176
|
+
modelKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
177
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
178
|
+
}, z.core.$loose>>;
|
|
179
|
+
};
|
|
180
|
+
export declare const subscriptionOutputSchema: {
|
|
181
|
+
messages: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
182
|
+
duration: z.ZodOptional<z.ZodUnknown>;
|
|
183
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
184
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.subscriptionOutputSchema = exports.fileListOutputSchema = exports.fileSchema = exports.armProfileOutputSchema = exports.armProfileListOutputSchema = exports.armProfileSchema = exports.liveviewListOutputSchema = exports.liveviewOutputSchema = exports.liveviewSchema = exports.ulpUserListOutputSchema = exports.ulpUserOutputSchema = exports.ulpUserSchema = exports.userListOutputSchema = exports.userOutputSchema = exports.userSchema = exports.nvrOutputSchema = exports.nvrSchema = exports.infoOutputSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_js_1 = require("./common.js");
|
|
6
|
+
/**
|
|
7
|
+
* Schemas below are verified against live UniFi Protect Integration API 7.1.60
|
|
8
|
+
* responses (Melrose NVR Pro console, 2026-05-15). The Integration API surface
|
|
9
|
+
* is much thinner than the internal Protect app API — only the fields observed
|
|
10
|
+
* in real responses are typed; `.passthrough()` still allows anything extra a
|
|
11
|
+
* different firmware/hardware mix might add.
|
|
12
|
+
*/
|
|
13
|
+
// --- System ---
|
|
14
|
+
exports.infoOutputSchema = {
|
|
15
|
+
applicationVersion: (0, common_js_1.nullableString)("Current Protect application version"),
|
|
16
|
+
};
|
|
17
|
+
// GET /nvrs returns a SINGLE nvr object (not an array, despite the tool name).
|
|
18
|
+
const armModeSchema = (0, common_js_1.passthroughObject)({
|
|
19
|
+
status: (0, common_js_1.nullableString)("disabled | armed | ..."),
|
|
20
|
+
armedAt: (0, common_js_1.unknownField)("Unix epoch ms when armed, or null (number|null)"),
|
|
21
|
+
willBeArmedAt: (0, common_js_1.unknownField)("Scheduled arm time, or null (number|null)"),
|
|
22
|
+
breachDetectedAt: (0, common_js_1.unknownField)("Unix epoch ms of last breach, or null"),
|
|
23
|
+
breachEventCount: (0, common_js_1.unknownField)("Count of breach events (number)"),
|
|
24
|
+
breachTriggerEventId: (0, common_js_1.unknownField)("Triggering event ID, or null (string|null)"),
|
|
25
|
+
breachEventId: (0, common_js_1.unknownField)("Breach event ID, or null (string|null)"),
|
|
26
|
+
});
|
|
27
|
+
const doorbellSettingsSchema = (0, common_js_1.passthroughObject)({
|
|
28
|
+
defaultMessageText: (0, common_js_1.nullableString)("Default doorbell LCD message"),
|
|
29
|
+
defaultMessageResetTimeoutMs: (0, common_js_1.unknownField)("Reset timeout in ms (number)"),
|
|
30
|
+
customMessages: (0, common_js_1.unknownField)("Configured custom LCD messages (array of strings)"),
|
|
31
|
+
customImages: (0, common_js_1.unknownField)("Configured custom LCD images (array)"),
|
|
32
|
+
});
|
|
33
|
+
exports.nvrSchema = (0, common_js_1.passthroughObject)({
|
|
34
|
+
id: (0, common_js_1.idField)("NVR ID"),
|
|
35
|
+
modelKey: (0, common_js_1.nullableString)('Always "nvr"'),
|
|
36
|
+
name: (0, common_js_1.nullableString)("NVR name"),
|
|
37
|
+
doorbellSettings: doorbellSettingsSchema.optional(),
|
|
38
|
+
armMode: armModeSchema.optional(),
|
|
39
|
+
});
|
|
40
|
+
// Single object — use the shape directly, NOT a list wrapper.
|
|
41
|
+
exports.nvrOutputSchema = { ...exports.nvrSchema.shape };
|
|
42
|
+
// --- Users ---
|
|
43
|
+
exports.userSchema = (0, common_js_1.passthroughObject)({
|
|
44
|
+
id: (0, common_js_1.idField)("User ID"),
|
|
45
|
+
modelKey: (0, common_js_1.nullableString)('Always "user"'),
|
|
46
|
+
name: (0, common_js_1.nullableString)("Display name"),
|
|
47
|
+
firstName: (0, common_js_1.nullableString)("First name"),
|
|
48
|
+
lastName: (0, common_js_1.nullableString)("Last name"),
|
|
49
|
+
email: (0, common_js_1.nullableString)("Email address"),
|
|
50
|
+
ucoreUserId: (0, common_js_1.nullableString)("UniFi Core user UUID"),
|
|
51
|
+
});
|
|
52
|
+
exports.userOutputSchema = { ...exports.userSchema.shape };
|
|
53
|
+
exports.userListOutputSchema = (0, common_js_1.listResultSchema)(exports.userSchema);
|
|
54
|
+
exports.ulpUserSchema = (0, common_js_1.passthroughObject)({
|
|
55
|
+
id: (0, common_js_1.idField)("ULP user UUID"),
|
|
56
|
+
modelKey: (0, common_js_1.nullableString)('Always "ulpUser"'),
|
|
57
|
+
firstName: (0, common_js_1.nullableString)("First name"),
|
|
58
|
+
lastName: (0, common_js_1.nullableString)("Last name"),
|
|
59
|
+
fullName: (0, common_js_1.nullableString)("Full name"),
|
|
60
|
+
status: (0, common_js_1.nullableString)("Account status, e.g. ACTIVE"),
|
|
61
|
+
});
|
|
62
|
+
exports.ulpUserOutputSchema = { ...exports.ulpUserSchema.shape };
|
|
63
|
+
exports.ulpUserListOutputSchema = (0, common_js_1.listResultSchema)(exports.ulpUserSchema);
|
|
64
|
+
// --- Liveviews ---
|
|
65
|
+
const liveviewSlotSchema = (0, common_js_1.passthroughObject)({
|
|
66
|
+
cameras: (0, common_js_1.unknownField)("Camera IDs shown in this slot (array of strings)"),
|
|
67
|
+
cycleMode: (0, common_js_1.nullableString)('Slot cycle mode, e.g. "time"'),
|
|
68
|
+
cycleInterval: (0, common_js_1.unknownField)("Cycle interval in seconds (number)"),
|
|
69
|
+
});
|
|
70
|
+
exports.liveviewSchema = (0, common_js_1.passthroughObject)({
|
|
71
|
+
id: (0, common_js_1.idField)("Liveview ID"),
|
|
72
|
+
modelKey: (0, common_js_1.nullableString)('Always "liveview"'),
|
|
73
|
+
name: (0, common_js_1.nullableString)("Liveview name"),
|
|
74
|
+
isDefault: (0, common_js_1.unknownField)("Whether this is the default liveview (boolean)"),
|
|
75
|
+
isGlobal: (0, common_js_1.unknownField)("Whether shared across all users (boolean)"),
|
|
76
|
+
layout: (0, common_js_1.unknownField)("Grid layout / slot count (number)"),
|
|
77
|
+
owner: (0, common_js_1.nullableString)("Owning user ID"),
|
|
78
|
+
slots: zod_1.z.array(liveviewSlotSchema).optional().describe("Camera slots"),
|
|
79
|
+
});
|
|
80
|
+
exports.liveviewOutputSchema = { ...exports.liveviewSchema.shape };
|
|
81
|
+
exports.liveviewListOutputSchema = (0, common_js_1.listResultSchema)(exports.liveviewSchema);
|
|
82
|
+
// --- Arm profiles ---
|
|
83
|
+
// No instances on the verification console — fields unverified. Kept minimal:
|
|
84
|
+
// only the identity field is typed; everything else flows via passthrough.
|
|
85
|
+
exports.armProfileSchema = (0, common_js_1.passthroughObject)({
|
|
86
|
+
id: (0, common_js_1.idField)("Arm profile ID"),
|
|
87
|
+
modelKey: (0, common_js_1.nullableString)("Resource kind"),
|
|
88
|
+
name: (0, common_js_1.nullableString)("Arm profile name"),
|
|
89
|
+
});
|
|
90
|
+
exports.armProfileListOutputSchema = (0, common_js_1.listResultSchema)(exports.armProfileSchema);
|
|
91
|
+
exports.armProfileOutputSchema = { ...exports.armProfileSchema.shape };
|
|
92
|
+
// --- Files ---
|
|
93
|
+
// `protect_list_files` (only fileType=animations supported) — unverified shape.
|
|
94
|
+
exports.fileSchema = (0, common_js_1.passthroughObject)({
|
|
95
|
+
id: (0, common_js_1.idField)("File ID"),
|
|
96
|
+
modelKey: (0, common_js_1.nullableString)("Resource kind"),
|
|
97
|
+
name: (0, common_js_1.nullableString)("File name"),
|
|
98
|
+
});
|
|
99
|
+
exports.fileListOutputSchema = (0, common_js_1.listResultSchema)(exports.fileSchema);
|
|
100
|
+
// --- Subscriptions ---
|
|
101
|
+
exports.subscriptionOutputSchema = {
|
|
102
|
+
messages: zod_1.z
|
|
103
|
+
.array(zod_1.z.unknown())
|
|
104
|
+
.optional()
|
|
105
|
+
.describe("Captured WebSocket messages (add/update/remove or event envelopes)"),
|
|
106
|
+
duration: (0, common_js_1.unknownField)("Actual listen duration in seconds (number)"),
|
|
107
|
+
error: (0, common_js_1.nullableString)("Connection error, if any"),
|
|
108
|
+
};
|
|
@@ -5,10 +5,12 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const responses_js_1 = require("../utils/responses.js");
|
|
6
6
|
const safety_js_1 = require("../utils/safety.js");
|
|
7
7
|
const url_js_1 = require("../utils/url.js");
|
|
8
|
+
const misc_js_1 = require("../schemas/misc.js");
|
|
8
9
|
const ACTIVATION_DELAY_VALUES = [0, 60000, 300000, 600000];
|
|
9
10
|
function registerArmProfileTools(server, client, readOnly) {
|
|
10
11
|
server.registerTool("protect_list_arm_profiles", {
|
|
11
|
-
description: "List all arm profiles
|
|
12
|
+
description: "List all arm profiles (only available when using the local alarm manager — the standalone NVR alarm system, not Protect cloud alerts). Returns array. Response shape is NOT verified against Protect 7.1.60 (no arm profiles on the reference console); expect at least id, modelKey, name plus profile configuration fields — inspect a live response to confirm.",
|
|
13
|
+
outputSchema: misc_js_1.armProfileListOutputSchema,
|
|
12
14
|
annotations: safety_js_1.READ_ONLY,
|
|
13
15
|
}, async () => {
|
|
14
16
|
try {
|
|
@@ -33,6 +35,7 @@ function registerArmProfileTools(server, client, readOnly) {
|
|
|
33
35
|
.describe("Activation delay in milliseconds. Allowed: 0 (none), 60000 (1m), 300000 (5m), 600000 (10m)."),
|
|
34
36
|
dryRun: zod_1.z.boolean().optional().describe("If true, return what would happen without making changes"),
|
|
35
37
|
},
|
|
38
|
+
outputSchema: misc_js_1.armProfileOutputSchema,
|
|
36
39
|
annotations: safety_js_1.WRITE,
|
|
37
40
|
}, async ({ name, automations, schedules, recordEverything, activationDelay, dryRun }) => {
|
|
38
41
|
try {
|
|
@@ -76,6 +79,7 @@ function registerArmProfileTools(server, client, readOnly) {
|
|
|
76
79
|
.describe(`Partial arm profile settings. Known fields: name (string 1-255 chars), automations (array of strings), schedules (array of objects), recordEverything (boolean), activationDelay (number, allowed: ${ACTIVATION_DELAY_VALUES.join(", ")})`),
|
|
77
80
|
dryRun: zod_1.z.boolean().optional().describe("If true, return what would happen without making changes"),
|
|
78
81
|
},
|
|
82
|
+
outputSchema: misc_js_1.armProfileOutputSchema,
|
|
79
83
|
annotations: safety_js_1.WRITE,
|
|
80
84
|
}, async ({ id, settings, dryRun }) => {
|
|
81
85
|
try {
|
package/dist/tools/cameras.js
CHANGED
|
@@ -5,10 +5,12 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const responses_js_1 = require("../utils/responses.js");
|
|
6
6
|
const safety_js_1 = require("../utils/safety.js");
|
|
7
7
|
const url_js_1 = require("../utils/url.js");
|
|
8
|
+
const cameras_js_1 = require("../schemas/cameras.js");
|
|
8
9
|
function registerCameraTools(server, client, readOnly) {
|
|
9
10
|
// --- Read-only tools (always registered) ---
|
|
10
11
|
server.registerTool("protect_list_cameras", {
|
|
11
|
-
description: "List all cameras managed by UniFi Protect",
|
|
12
|
+
description: "List all cameras managed by UniFi Protect. Returns array; each camera includes (Integration API 7.1.60-verified fields): id, mac, name, modelKey, state (CONNECTED/DISCONNECTED), activePatrolSlot, hasPackageCamera, hdrType, isMicEnabled, micVolume, videoMode, featureFlags (hasHdr, hasMic, hasSpeaker, hasLedStatus, smartDetectTypes[], smartDetectAudioTypes[], videoModes[], supportFullHdSnapshot), lcdMessage, ledSettings (isEnabled, floodLed, welcomeLed), osdSettings (isNameEnabled, isDateEnabled, isLogoEnabled, isDebugEnabled, overlayLocation), smartDetectSettings (objectTypes[], audioTypes[]). The Integration API does NOT expose recording state, motion timestamps, connection/last-seen, firmware, host, or per-channel stream config.",
|
|
13
|
+
outputSchema: cameras_js_1.cameraListOutputSchema,
|
|
12
14
|
annotations: safety_js_1.READ_ONLY,
|
|
13
15
|
}, async () => {
|
|
14
16
|
try {
|
|
@@ -20,8 +22,9 @@ function registerCameraTools(server, client, readOnly) {
|
|
|
20
22
|
}
|
|
21
23
|
});
|
|
22
24
|
server.registerTool("protect_get_camera", {
|
|
23
|
-
description: "Get details for a specific camera by ID",
|
|
25
|
+
description: "Get details for a specific camera by ID. The Protect Integration API returns the SAME field set as protect_list_cameras entries (id, mac, name, modelKey, state, activePatrolSlot, hasPackageCamera, hdrType, isMicEnabled, micVolume, videoMode, featureFlags, lcdMessage, ledSettings, osdSettings, smartDetectSettings) — there is no extended/by-id-only payload. Recording state, motion events, zones, and channel/RTSP config are NOT exposed by this API surface.",
|
|
24
26
|
inputSchema: { id: zod_1.z.string().describe("Camera ID") },
|
|
27
|
+
outputSchema: cameras_js_1.cameraOutputSchema,
|
|
25
28
|
annotations: safety_js_1.READ_ONLY,
|
|
26
29
|
}, async ({ id }) => {
|
|
27
30
|
try {
|
|
@@ -33,7 +36,7 @@ function registerCameraTools(server, client, readOnly) {
|
|
|
33
36
|
}
|
|
34
37
|
});
|
|
35
38
|
server.registerTool("protect_get_snapshot", {
|
|
36
|
-
description: "Get a JPEG snapshot from a camera (
|
|
39
|
+
description: "Get a JPEG snapshot from a camera. Returns a base64-encoded image/jpeg (rendered directly by MCP clients). Use highQuality=true for full-resolution capture from the camera's main channel; otherwise a low-res thumbnail is returned.",
|
|
37
40
|
inputSchema: {
|
|
38
41
|
id: zod_1.z.string().describe("Camera ID"),
|
|
39
42
|
highQuality: zod_1.z
|
|
@@ -63,8 +66,9 @@ function registerCameraTools(server, client, readOnly) {
|
|
|
63
66
|
}
|
|
64
67
|
});
|
|
65
68
|
server.registerTool("protect_get_rtsp_streams", {
|
|
66
|
-
description: "Get active RTSPS stream sessions for a camera",
|
|
69
|
+
description: "Get active RTSPS stream sessions for a camera. Returns the per-quality stream URLs currently published (keys typically: high, medium, low, package). Empty/missing keys mean no session is currently active at that quality — use protect_create_rtsp_stream to start one.",
|
|
67
70
|
inputSchema: { id: zod_1.z.string().describe("Camera ID") },
|
|
71
|
+
outputSchema: cameras_js_1.rtspStreamOutputSchema,
|
|
68
72
|
annotations: safety_js_1.READ_ONLY,
|
|
69
73
|
}, async ({ id }) => {
|
|
70
74
|
try {
|
|
@@ -90,6 +94,7 @@ function registerCameraTools(server, client, readOnly) {
|
|
|
90
94
|
.optional()
|
|
91
95
|
.describe("If true, return what would happen without making changes"),
|
|
92
96
|
},
|
|
97
|
+
outputSchema: cameras_js_1.cameraOutputSchema,
|
|
93
98
|
annotations: safety_js_1.WRITE,
|
|
94
99
|
}, async ({ id, settings, dryRun }) => {
|
|
95
100
|
try {
|
|
@@ -115,6 +120,7 @@ function registerCameraTools(server, client, readOnly) {
|
|
|
115
120
|
.optional()
|
|
116
121
|
.describe("If true, return what would happen without making changes"),
|
|
117
122
|
},
|
|
123
|
+
outputSchema: cameras_js_1.rtspStreamOutputSchema,
|
|
118
124
|
annotations: safety_js_1.WRITE,
|
|
119
125
|
}, async ({ id, qualities, dryRun }) => {
|
|
120
126
|
try {
|
|
@@ -164,6 +170,7 @@ function registerCameraTools(server, client, readOnly) {
|
|
|
164
170
|
.optional()
|
|
165
171
|
.describe("If true, return what would happen without making changes"),
|
|
166
172
|
},
|
|
173
|
+
outputSchema: cameras_js_1.talkbackSessionOutputSchema,
|
|
167
174
|
annotations: safety_js_1.WRITE,
|
|
168
175
|
}, async ({ id, dryRun }) => {
|
|
169
176
|
try {
|
package/dist/tools/devices.d.ts
CHANGED
package/dist/tools/devices.js
CHANGED
|
@@ -6,6 +6,7 @@ const zod_1 = require("zod");
|
|
|
6
6
|
const responses_js_1 = require("../utils/responses.js");
|
|
7
7
|
const safety_js_1 = require("../utils/safety.js");
|
|
8
8
|
const url_js_1 = require("../utils/url.js");
|
|
9
|
+
const devices_js_1 = require("../schemas/devices.js");
|
|
9
10
|
const DEVICES = [
|
|
10
11
|
{
|
|
11
12
|
urlPath: "lights",
|
|
@@ -13,6 +14,7 @@ const DEVICES = [
|
|
|
13
14
|
plural: "lights",
|
|
14
15
|
label: "Light",
|
|
15
16
|
hint: "Known fields: name (string), isLightForceEnabled (boolean), lightModeSettings (object with mode, enableAt), lightDeviceSettings (object with isIndicatorEnabled, pirDuration, pirSensitivity, ledLevel)",
|
|
17
|
+
returns: "id, modelKey, name, mac, state (universal identity fields). Protect Integration API 7.1.60 returns a thin object; additional device-specific fields are NOT verified (no instances on reference console) — inspect a live response before relying on them",
|
|
16
18
|
},
|
|
17
19
|
{
|
|
18
20
|
urlPath: "sensors",
|
|
@@ -20,6 +22,7 @@ const DEVICES = [
|
|
|
20
22
|
plural: "sensors",
|
|
21
23
|
label: "Sensor",
|
|
22
24
|
hint: "Known fields: name (string), motionSettings (object), humiditySettings (object), temperatureSettings (object), lightSettings (object), alarmSettings (object)",
|
|
25
|
+
returns: "id, modelKey, name, mac, state (universal identity fields). Protect Integration API 7.1.60 returns a thin object; additional device-specific fields are NOT verified (no instances on reference console) — inspect a live response before relying on them",
|
|
23
26
|
},
|
|
24
27
|
{
|
|
25
28
|
urlPath: "chimes",
|
|
@@ -27,6 +30,7 @@ const DEVICES = [
|
|
|
27
30
|
plural: "chimes",
|
|
28
31
|
label: "Chime",
|
|
29
32
|
hint: "Known fields: name (string), cameraIds (array of camera IDs linked to the chime), ringSettings (array of ring tone configurations)",
|
|
33
|
+
returns: "id, modelKey, name, mac, state (universal identity fields). Protect Integration API 7.1.60 returns a thin object; additional device-specific fields are NOT verified (no instances on reference console) — inspect a live response before relying on them",
|
|
30
34
|
},
|
|
31
35
|
{
|
|
32
36
|
urlPath: "viewers",
|
|
@@ -34,6 +38,7 @@ const DEVICES = [
|
|
|
34
38
|
plural: "viewers",
|
|
35
39
|
label: "Viewer",
|
|
36
40
|
hint: "Known fields: name (string), liveview (string, liveview ID to display)",
|
|
41
|
+
returns: "id, modelKey, name, mac, state (universal identity fields). Protect Integration API 7.1.60 returns a thin object; additional device-specific fields are NOT verified (no instances on reference console) — inspect a live response before relying on them",
|
|
37
42
|
},
|
|
38
43
|
{
|
|
39
44
|
urlPath: "sirens",
|
|
@@ -41,6 +46,7 @@ const DEVICES = [
|
|
|
41
46
|
plural: "sirens",
|
|
42
47
|
label: "Siren",
|
|
43
48
|
hint: "Known fields: name (string), volume (integer 1-100), ledSettings (object with isEnabled boolean)",
|
|
49
|
+
returns: "id, modelKey, name, mac, state (universal identity fields). Protect Integration API 7.1.60 returns a thin object; additional device-specific fields are NOT verified (no instances on reference console) — inspect a live response before relying on them",
|
|
44
50
|
},
|
|
45
51
|
{
|
|
46
52
|
urlPath: "fobs",
|
|
@@ -48,6 +54,7 @@ const DEVICES = [
|
|
|
48
54
|
plural: "fobs",
|
|
49
55
|
label: "Fob",
|
|
50
56
|
hint: "Known fields: name (string)",
|
|
57
|
+
returns: "id, modelKey, name, mac, state (universal identity fields). Protect Integration API 7.1.60 returns a thin object; additional device-specific fields are NOT verified (no instances on reference console) — inspect a live response before relying on them",
|
|
51
58
|
},
|
|
52
59
|
{
|
|
53
60
|
urlPath: "relays",
|
|
@@ -55,6 +62,7 @@ const DEVICES = [
|
|
|
55
62
|
plural: "relays",
|
|
56
63
|
label: "Relay",
|
|
57
64
|
hint: "Known fields: name (string), ledSettings (object with isEnabled boolean)",
|
|
65
|
+
returns: "id, modelKey, name, mac, state (universal identity fields). Protect Integration API 7.1.60 returns a thin object; additional device-specific fields are NOT verified (no instances on reference console) — inspect a live response before relying on them",
|
|
58
66
|
},
|
|
59
67
|
{
|
|
60
68
|
urlPath: "speakers",
|
|
@@ -62,6 +70,7 @@ const DEVICES = [
|
|
|
62
70
|
plural: "speakers",
|
|
63
71
|
label: "Speaker",
|
|
64
72
|
hint: "Known fields: name (string), volume (integer 0-100), micVolume (integer 0-100), isMicEnabled (boolean)",
|
|
73
|
+
returns: "id, modelKey, name, mac, state (universal identity fields). Protect Integration API 7.1.60 returns a thin object; additional device-specific fields are NOT verified (no instances on reference console) — inspect a live response before relying on them",
|
|
65
74
|
},
|
|
66
75
|
{
|
|
67
76
|
urlPath: "bridges",
|
|
@@ -69,6 +78,7 @@ const DEVICES = [
|
|
|
69
78
|
plural: "bridges",
|
|
70
79
|
label: "Bridge",
|
|
71
80
|
hint: "Known fields: name (string)",
|
|
81
|
+
returns: "id, modelKey, name, mac, state (universal identity fields). Protect Integration API 7.1.60 returns a thin object; additional device-specific fields are NOT verified (no instances on reference console) — inspect a live response before relying on them",
|
|
72
82
|
},
|
|
73
83
|
{
|
|
74
84
|
urlPath: "link-stations",
|
|
@@ -76,6 +86,7 @@ const DEVICES = [
|
|
|
76
86
|
plural: "link_stations",
|
|
77
87
|
label: "Link station",
|
|
78
88
|
hint: "Known fields: name (string)",
|
|
89
|
+
returns: "id, modelKey, name, mac, state (universal identity fields). Protect Integration API 7.1.60 returns a thin object; additional device-specific fields are NOT verified (no instances on reference console) — inspect a live response before relying on them",
|
|
79
90
|
},
|
|
80
91
|
{
|
|
81
92
|
urlPath: "alarm-hubs",
|
|
@@ -83,11 +94,14 @@ const DEVICES = [
|
|
|
83
94
|
plural: "alarm_hubs",
|
|
84
95
|
label: "Alarm hub",
|
|
85
96
|
hint: "Known fields: name (string)",
|
|
97
|
+
returns: "id, modelKey, name, mac, state (universal identity fields). Protect Integration API 7.1.60 returns a thin object; additional device-specific fields are NOT verified (no instances on reference console) — inspect a live response before relying on them",
|
|
86
98
|
},
|
|
87
99
|
];
|
|
88
100
|
function registerDeviceCrud(server, client, cfg, readOnly) {
|
|
101
|
+
const schemaKey = cfg.singular;
|
|
89
102
|
server.registerTool(`protect_list_${cfg.plural}`, {
|
|
90
|
-
description: `List all ${cfg.label.toLowerCase()}s managed by UniFi Protect
|
|
103
|
+
description: `List all ${cfg.label.toLowerCase()}s managed by UniFi Protect. Returns array; each ${cfg.label.toLowerCase()} includes: ${cfg.returns}.`,
|
|
104
|
+
outputSchema: (0, devices_js_1.listOutputShape)(schemaKey),
|
|
91
105
|
annotations: safety_js_1.READ_ONLY,
|
|
92
106
|
}, async () => {
|
|
93
107
|
try {
|
|
@@ -99,8 +113,9 @@ function registerDeviceCrud(server, client, cfg, readOnly) {
|
|
|
99
113
|
}
|
|
100
114
|
});
|
|
101
115
|
server.registerTool(`protect_get_${cfg.singular}`, {
|
|
102
|
-
description: `Get details for a specific ${cfg.label.toLowerCase()} by ID
|
|
116
|
+
description: `Get full details for a specific ${cfg.label.toLowerCase()} by ID. Returns: ${cfg.returns}.`,
|
|
103
117
|
inputSchema: { id: zod_1.z.string().describe(`${cfg.label} ID`) },
|
|
118
|
+
outputSchema: (0, devices_js_1.itemOutputShape)(schemaKey),
|
|
104
119
|
annotations: safety_js_1.READ_ONLY,
|
|
105
120
|
}, async ({ id }) => {
|
|
106
121
|
try {
|
|
@@ -124,6 +139,7 @@ function registerDeviceCrud(server, client, cfg, readOnly) {
|
|
|
124
139
|
.optional()
|
|
125
140
|
.describe("If true, return what would happen without making changes"),
|
|
126
141
|
},
|
|
142
|
+
outputSchema: (0, devices_js_1.itemOutputShape)(schemaKey),
|
|
127
143
|
annotations: safety_js_1.WRITE,
|
|
128
144
|
}, async ({ id, settings, dryRun }) => {
|
|
129
145
|
try {
|
package/dist/tools/files.js
CHANGED
|
@@ -5,14 +5,16 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const responses_js_1 = require("../utils/responses.js");
|
|
6
6
|
const safety_js_1 = require("../utils/safety.js");
|
|
7
7
|
const url_js_1 = require("../utils/url.js");
|
|
8
|
+
const misc_js_1 = require("../schemas/misc.js");
|
|
8
9
|
function registerFileTools(server, client, readOnly) {
|
|
9
10
|
server.registerTool("protect_list_files", {
|
|
10
|
-
description: "List files of a given type (only 'animations' is supported)",
|
|
11
|
+
description: "List files of a given type (only 'animations' is currently supported — GIF clips uploadable to G4 Doorbell screens). Returns array. Per-record shape is NOT verified against Protect 7.1.60 (no files on the reference console) — inspect a live response to confirm fields.",
|
|
11
12
|
inputSchema: {
|
|
12
13
|
fileType: zod_1.z
|
|
13
14
|
.string()
|
|
14
15
|
.describe("File type to list (only 'animations' is currently supported)"),
|
|
15
16
|
},
|
|
17
|
+
outputSchema: misc_js_1.fileListOutputSchema,
|
|
16
18
|
annotations: safety_js_1.READ_ONLY,
|
|
17
19
|
}, async ({ fileType }) => {
|
|
18
20
|
try {
|
package/dist/tools/liveviews.js
CHANGED
|
@@ -5,9 +5,11 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const responses_js_1 = require("../utils/responses.js");
|
|
6
6
|
const safety_js_1 = require("../utils/safety.js");
|
|
7
7
|
const url_js_1 = require("../utils/url.js");
|
|
8
|
+
const misc_js_1 = require("../schemas/misc.js");
|
|
8
9
|
function registerLiveviewTools(server, client, readOnly) {
|
|
9
10
|
server.registerTool("protect_list_liveviews", {
|
|
10
|
-
description: "List all live views
|
|
11
|
+
description: "List all live views (camera grid layouts shown on viewers / in the Protect UI). Returns array; each liveview includes (Integration API 7.1.60-verified): id, modelKey, name, isDefault, isGlobal, layout (number, slot count), owner (user ID), slots (array of {cameras: string[], cycleMode, cycleInterval}). NOTE: slots use a `cameras` string-array, not a single `cameraId`.",
|
|
12
|
+
outputSchema: misc_js_1.liveviewListOutputSchema,
|
|
11
13
|
annotations: safety_js_1.READ_ONLY,
|
|
12
14
|
}, async () => {
|
|
13
15
|
try {
|
|
@@ -19,8 +21,9 @@ function registerLiveviewTools(server, client, readOnly) {
|
|
|
19
21
|
}
|
|
20
22
|
});
|
|
21
23
|
server.registerTool("protect_get_liveview", {
|
|
22
|
-
description: "Get details for a specific live view by ID",
|
|
24
|
+
description: "Get details for a specific live view by ID. Returns: id, modelKey, name, isDefault, isGlobal, layout, owner, slots (each slot: cameras string[], cycleMode, cycleInterval). The full slot list is needed when updating because PATCH replaces the slots array.",
|
|
23
25
|
inputSchema: { id: zod_1.z.string().describe("Liveview ID") },
|
|
26
|
+
outputSchema: misc_js_1.liveviewOutputSchema,
|
|
24
27
|
annotations: safety_js_1.READ_ONLY,
|
|
25
28
|
}, async ({ id }) => {
|
|
26
29
|
try {
|
|
@@ -44,6 +47,7 @@ function registerLiveviewTools(server, client, readOnly) {
|
|
|
44
47
|
.optional()
|
|
45
48
|
.describe("If true, return what would happen without making changes"),
|
|
46
49
|
},
|
|
50
|
+
outputSchema: misc_js_1.liveviewOutputSchema,
|
|
47
51
|
annotations: safety_js_1.WRITE,
|
|
48
52
|
}, async ({ settings, dryRun }) => {
|
|
49
53
|
try {
|
|
@@ -69,6 +73,7 @@ function registerLiveviewTools(server, client, readOnly) {
|
|
|
69
73
|
.optional()
|
|
70
74
|
.describe("If true, return what would happen without making changes"),
|
|
71
75
|
},
|
|
76
|
+
outputSchema: misc_js_1.liveviewOutputSchema,
|
|
72
77
|
annotations: safety_js_1.WRITE,
|
|
73
78
|
}, async ({ id, settings, dryRun }) => {
|
|
74
79
|
try {
|
|
@@ -4,6 +4,7 @@ exports.registerSubscriptionTools = registerSubscriptionTools;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const responses_js_1 = require("../utils/responses.js");
|
|
6
6
|
const safety_js_1 = require("../utils/safety.js");
|
|
7
|
+
const misc_js_1 = require("../schemas/misc.js");
|
|
7
8
|
const durationSchema = zod_1.z
|
|
8
9
|
.number()
|
|
9
10
|
.min(1)
|
|
@@ -43,8 +44,9 @@ function collectMessages(client, path, duration) {
|
|
|
43
44
|
}
|
|
44
45
|
function registerSubscriptionTools(server, client) {
|
|
45
46
|
server.registerTool("protect_subscribe_devices", {
|
|
46
|
-
description: "Connect to the device update WebSocket and collect messages for a specified duration. Returns
|
|
47
|
+
description: "Connect to the device update WebSocket and collect messages for a specified duration (1-30s). Returns {messages, duration, error?}; each message has {type: 'add'|'update'|'remove', modelKey: 'camera'|'light'|'sensor'|..., id, payload: partial device fields that changed}. Use to detect state changes like isRecording flipping, battery drops, or new devices being adopted — fields delivered are only those that changed, not the full device object.",
|
|
47
48
|
inputSchema: { duration: durationSchema },
|
|
49
|
+
outputSchema: misc_js_1.subscriptionOutputSchema,
|
|
48
50
|
annotations: safety_js_1.READ_ONLY,
|
|
49
51
|
}, async ({ duration }) => {
|
|
50
52
|
try {
|
|
@@ -56,8 +58,9 @@ function registerSubscriptionTools(server, client) {
|
|
|
56
58
|
}
|
|
57
59
|
});
|
|
58
60
|
server.registerTool("protect_subscribe_events", {
|
|
59
|
-
description: "Connect to the Protect event WebSocket and collect messages for a specified duration. Returns
|
|
61
|
+
description: "Connect to the Protect event WebSocket and collect messages for a specified duration (1-30s). Returns {messages, duration, error?}; each event message includes: id, type ('motion' | 'ring' | 'smartDetectZone' | 'smartDetectLine' | 'sensorMotion' | 'sensorAlarm' | 'fingerprint' | 'nfcCard' | ...), start, end (null while ongoing), camera/sensor id, score, smartDetectTypes (['person','vehicle','animal','package','license_plate','face']), metadata (e.g. detected license plate text, NFC card id, fingerprint id, ULP user match).",
|
|
60
62
|
inputSchema: { duration: durationSchema },
|
|
63
|
+
outputSchema: misc_js_1.subscriptionOutputSchema,
|
|
61
64
|
annotations: safety_js_1.READ_ONLY,
|
|
62
65
|
}, async ({ duration }) => {
|
|
63
66
|
try {
|
package/dist/tools/system.js
CHANGED
|
@@ -3,9 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.registerSystemTools = registerSystemTools;
|
|
4
4
|
const responses_js_1 = require("../utils/responses.js");
|
|
5
5
|
const safety_js_1 = require("../utils/safety.js");
|
|
6
|
+
const misc_js_1 = require("../schemas/misc.js");
|
|
6
7
|
function registerSystemTools(server, client) {
|
|
7
8
|
server.registerTool("protect_get_info", {
|
|
8
|
-
description: "Get UniFi Protect
|
|
9
|
+
description: "Get UniFi Protect application information. Returns: applicationVersion (string).",
|
|
10
|
+
outputSchema: misc_js_1.infoOutputSchema,
|
|
9
11
|
annotations: safety_js_1.READ_ONLY,
|
|
10
12
|
}, async () => {
|
|
11
13
|
try {
|
|
@@ -17,7 +19,8 @@ function registerSystemTools(server, client) {
|
|
|
17
19
|
}
|
|
18
20
|
});
|
|
19
21
|
server.registerTool("protect_list_nvrs", {
|
|
20
|
-
description: "
|
|
22
|
+
description: "Get the NVR (Network Video Recorder) console info. NOTE: despite the name, the Protect Integration API's /nvrs endpoint returns a SINGLE NVR object, not an array. Returns: id, modelKey, name, doorbellSettings (defaultMessageText, defaultMessageResetTimeoutMs, customMessages[], customImages[]), armMode (status, armedAt, willBeArmedAt, breachDetectedAt, breachEventCount, breachTriggerEventId, breachEventId).",
|
|
23
|
+
outputSchema: misc_js_1.nvrOutputSchema,
|
|
21
24
|
annotations: safety_js_1.READ_ONLY,
|
|
22
25
|
}, async () => {
|
|
23
26
|
try {
|