rhombus-node-mcp 0.1.33 → 0.1.34
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.
|
@@ -29,6 +29,29 @@ What follows is a description of the behavior of this tool given the requestType
|
|
|
29
29
|
This tool retrieves the current configuration for a specified camera or associated device (e.g., sensor, access controller). The returned JSON object can include detailed camera settings (e.g., resolution, bitrate) and various device-specific configurations (e.g. storage settings).
|
|
30
30
|
|
|
31
31
|
NOTE: To update camera settings, use the update-tool instead.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
**AUTOMATIC SNAPSHOT FOR IMAGE QUALITY ISSUES** — When a user mentions camera image quality (darkness, brightness, blur, washed out, "doesn't look great", "fix the image", etc.), you MUST IMMEDIATELY:
|
|
36
|
+
1. Call camera-tool with requestType "image" to capture a snapshot WITHOUT asking first.
|
|
37
|
+
2. Analyze the image to identify quality issues.
|
|
38
|
+
3. Call camera-tool with requestType "get-settings" to check current camera settings.
|
|
39
|
+
4. Propose specific setting changes based on your analysis (store the exact values you plan to change, e.g. img_brightness, wdr_strength).
|
|
40
|
+
5. When the user confirms ("yes", "confirm", "fix it", "apply", "go ahead", "ok", etc.), call update-tool with those stored settings — see update-tool's description for the confirmation flow. NEVER skip the update-tool call.
|
|
41
|
+
|
|
42
|
+
Examples that REQUIRE the automatic snapshot flow:
|
|
43
|
+
- "This camera's image doesn't look great"
|
|
44
|
+
- "The image quality is poor"
|
|
45
|
+
- "Can you fix the image"
|
|
46
|
+
- "Adjust settings to be optimal"
|
|
47
|
+
- "The camera looks blurry/dark/washed out"
|
|
48
|
+
- Any mention of image appearance problems.
|
|
49
|
+
|
|
50
|
+
**VISUAL-FEATURE CAMERA FILTERING** — When the user asks for cameras filtered by what they can see (indoors/outdoors, "facing the street", "with a view of X", parking lot, entrance), you MUST:
|
|
51
|
+
1. First get the camera list via get-entity-tool or location-tool.
|
|
52
|
+
2. Then call camera-tool with requestType "image" for EACH candidate camera (in PARALLEL).
|
|
53
|
+
3. Analyze each image to determine if it meets the user's criteria.
|
|
54
|
+
4. Return only the cameras that match.
|
|
32
55
|
`;
|
|
33
56
|
const logger = getLogger("camera-tool");
|
|
34
57
|
const TOOL_ARGS = BASE_TOOL_ARGS;
|
|
@@ -23,6 +23,20 @@ It has the following modes of operation, determined by the "requestType" paramet
|
|
|
23
23
|
- ${DoorScheduleExceptionRequestType.UPDATE_EXCEPTION}: Update a door schedule exception. Requires exception (DoorScheduleExceptionType object). If intervals are omitted but defaultState and date range are provided, the tool will generate a full-day interval.
|
|
24
24
|
|
|
25
25
|
Use get-entity-tool to look up location and door UUIDs when needed.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
**Mutating doorUuids on an existing exception (add/remove/replace doors):**
|
|
30
|
+
\`update-exception\` REPLACES \`doorUuids\` with whatever you pass — it is not a delta operation. To safely remove or add doors while preserving the others:
|
|
31
|
+
|
|
32
|
+
1. Call \`find-exceptions\` (or \`get-exception\`) to fetch the exception. The response includes the **full \`doorUuids\` array** for that exception — that IS the current door list.
|
|
33
|
+
2. Compute the new array yourself:
|
|
34
|
+
- **Remove doors:** filter the existing \`doorUuids\` array, dropping the ones to remove.
|
|
35
|
+
- **Add doors:** append the new UUIDs to the existing array (deduped).
|
|
36
|
+
- **Replace wholesale:** just use the new set.
|
|
37
|
+
3. Call \`update-exception\` with \`exception.uuid\` and \`exception.doorUuids\` set to your computed array. Other fields (name, dates, intervals, defaultState) are optional — omit them to leave them unchanged.
|
|
38
|
+
|
|
39
|
+
**You already have the current door list in the find-exceptions response.** Do not ask the user for it, do not claim you need additional lookups, and do not refuse the mutation citing missing context. The doorUuids array you got back IS the context.
|
|
26
40
|
`;
|
|
27
41
|
function buildDateRangeFilter(args) {
|
|
28
42
|
return {
|
|
@@ -4,15 +4,14 @@ import { TOOL_ARGS } from "../types/get-entity-tool-types.js";
|
|
|
4
4
|
import { createToolTextContent, extractFromToolExtra } from "../util.js";
|
|
5
5
|
const TOOL_NAME = "get-entity-tool";
|
|
6
6
|
const TOOL_DESCRIPTION = `
|
|
7
|
-
Retrieves entities (or devices) of certain types.
|
|
8
|
-
Can request multiple entity types at once.
|
|
9
|
-
The return structure is a JSON string that contains the states of the requested entities.
|
|
10
|
-
This data is exact. Whatever entities exist will be returned here.
|
|
7
|
+
Retrieves entities (or devices) of certain types — cameras, doorbell cameras, badge readers, access-controlled doors, audio gateways, door sensors, environmental sensors, motion sensors, buttons, keypads, environmental gateways. Can request multiple entity types at once. The return structure is a JSON string that contains the states (including names, UUIDs, location, model, firmware, connection status) of the requested entities. This data is exact.
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
**Primary use cases:**
|
|
10
|
+
1. **Looking up a device by name.** When the user mentions a specific camera, door, sensor, etc. by name (e.g. "describe camera 1919 Front Door Entrance", "what's the status of HW Lab door"), call this tool with the matching entityType, scan the returned list, and **fuzzy/case-insensitive substring match** the user's reference against the \`name\` field. Don't ask the user to clarify — try this lookup first, and only ask if there are genuinely multiple plausible matches in the results.
|
|
11
|
+
2. **Listing all devices of a type** (cameras, doors, sensors, etc.) for a location or org-wide.
|
|
12
|
+
3. **Checking device health and connectivity.** Each device includes a \`connected\` boolean (true = online, false = offline). For "which devices are offline?" / "is X online?" / health questions, fetch the relevant entityTypes and inspect \`connected\`.
|
|
13
|
+
|
|
14
|
+
When the user asks to "describe", "look up", "find", "show me", or "tell me about" a named device, this is almost always the right starting tool — call it before asking the user for more specifics.`;
|
|
16
15
|
const TOOL_HANDLER = async (args, extra) => {
|
|
17
16
|
const { entityTypes, timeZone, tempUnit } = args;
|
|
18
17
|
const filterBy = args.filterBy ?? { locationUuids: null };
|
|
@@ -6,6 +6,8 @@ const TOOL_NAME = "report-tool";
|
|
|
6
6
|
const TOOL_DESCRIPTION = `
|
|
7
7
|
**Scope:** This tool returns **aggregated counts and time-series summaries** over specified intervals and scopes. Use **events-tool** when you need raw, event-level data (individual events with timestamps). Use this tool for high-level reports, analytics, and trends—especially over periods of a day or more.
|
|
8
8
|
|
|
9
|
+
**Interval guidance:** A shorter interval (HOURLY instead of DAILY) gives a better representation of data over time. Balance interval and range so you don't request too much data. For ranges spanning a week or so, HOURLY is appropriate.
|
|
10
|
+
|
|
9
11
|
---
|
|
10
12
|
|
|
11
13
|
**People / occupancy counting strategy**
|
package/dist/tools/time-tool.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { parseTimeDescription } from "../api/time-tool-api.js";
|
|
2
2
|
import { TOOL_ARGS } from "../types/time-tool-types.js";
|
|
3
3
|
const TOOL_NAME = "time-tool";
|
|
4
|
-
const TOOL_DESCRIPTION =
|
|
4
|
+
const TOOL_DESCRIPTION = `This tool returns timestamps from natural-language descriptions of time. If the user asks about the "current time", use this tool. Keep time_description as close to the user's original phrasing as possible — e.g. for "was X person seen today?" use time_description "today".
|
|
5
|
+
|
|
6
|
+
**When to call:** Whenever the user provides a natural-language time description ("today", "5 days ago", "last week", "this morning"), call time-tool to get accurate timestamps. Do not invent timestamps yourself. If you will need a timestamp as input to another tool, call time-tool first; multiple parallel calls are fine.
|
|
7
|
+
|
|
8
|
+
**Default timezone:** Assume "America/Los_Angeles" unless the user specifies otherwise or device/location context indicates a different one.`;
|
|
5
9
|
const TOOL_HANDLER = async (args, extra) => {
|
|
6
10
|
const { time_description, timezone } = args;
|
|
7
11
|
const result = parseTimeDescription(time_description ?? undefined, timezone ?? undefined, extra);
|
|
@@ -27,6 +27,21 @@ Future support planned for:
|
|
|
27
27
|
- Badge readers
|
|
28
28
|
|
|
29
29
|
The tool uses elicitation forms for rich user interaction and shows current settings before updates.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
**CAMERA SETTINGS UPDATE FLOW** — Use this tool for ALL camera settings updates (brightness, contrast, WDR, resolution, audio, LED, etc.).
|
|
34
|
+
- For camera image-quality fixes: provide entityType="camera", entityUuid, and the specific settings to change in cameraVideoSettings.
|
|
35
|
+
- Example for dark image: update-tool(entityType="camera", entityUuid="<uuid>", cameraVideoSettings='{"img_brightness": 0, "wdr_strength": 64}').
|
|
36
|
+
- Example for washed out: update-tool(entityType="camera", entityUuid="<uuid>", cameraVideoSettings='{"img_brightness": -50, "img_contrast": 80}').
|
|
37
|
+
- Saturation matters — saturation 0 yields a grayscale image. Most cameras look best with mid-range values; tune from there.
|
|
38
|
+
|
|
39
|
+
**CONFIRMATION FLOW (MANDATORY)** — When the conversation history shows you analyzed a camera and proposed fixes, and the user replies with any affirmative ("yes", "confirm", "fix it", "apply", "do it", "go ahead", "proceed", "sure", "ok"):
|
|
40
|
+
1. DO NOT generate any text response first.
|
|
41
|
+
2. IMMEDIATELY call update-tool with the camera settings you previously identified.
|
|
42
|
+
3. Only after update-tool returns successfully, say "Done! Check your camera now…".
|
|
43
|
+
|
|
44
|
+
NEVER respond saying settings were updated without first calling update-tool — without the call, no changes take effect. Avoid multiple rounds of confirmation; get one confirmation for all proposed changes.
|
|
30
45
|
`;
|
|
31
46
|
const TOOL_HANDLER = async (args, extra) => {
|
|
32
47
|
const { entityType, entityUuid, cameraVideoSettings, cameraAudioSettings, cameraDeviceSettings, step, } = args;
|