rhombus-node-mcp
Version:
MCP server for Rhombus API
60 lines (58 loc) • 2.56 kB
JavaScript
import { z } from "zod";
import { INCLUDE_FIELDS_ARG, FILTER_BY_ARG } from "../util.js";
export const VideoWallSettings = z.object({
numVisibleDevicesAtOnce: z.number().nullable().describe(`The number of devices to display at once. If there is no rotation strategy and/or interval,
then this value can be null.
If there is a rotation strategy, then this value must be between 1 and the number of devices.
Choose something reasonable, or ask the user for input.
`),
intervalSeconds: z.number().nullable(),
rotateStrategy: z.enum(["none", "motion", "interval"]),
});
export const CreateVideoWallOptions = z
.object({
displayName: z.string().nullable().describe("What to call the video wall"),
orgUuid: z.string().describe("The uuid of the organization"),
deviceList: z
.array(z.string())
.min(1)
.describe("The list of camera uuids (unique identifiers) to exist in the video wall. You must provide this manually by prompting the user at least once."),
othersCanEdit: z
.boolean()
.nullable()
.describe("Whether or not other users can edit the wall, defaults to false"),
settings: VideoWallSettings,
})
.nullable()
.describe("The options for creating a video wall. This is required if your requestType === `create`");
export const TOOL_ARGS = {
requestType: z
.enum(["list", "create"])
.describe("The type of request to make."),
videoWallCreateOptions: CreateVideoWallOptions,
includeFields: INCLUDE_FIELDS_ARG,
filterBy: FILTER_BY_ARG,
};
const TOOL_ARGS_SCHEMA = z.object(TOOL_ARGS);
export const OUTPUT_SCHEMA = z.object({
error: z
.optional(z.string())
.describe("If this field exists, then an error occured and contains the error message."),
needUserInput: z
.boolean()
.optional()
.describe("If this field exists and is true, then the tool requires additional input from the user."),
commandForUser: z
.string()
.optional()
.describe("If this field exists, then the tool requires additional input from the user."),
videoWalls: z
.array(z.any())
.describe("If requestType is `list`, then this field will be populated with the list of video walls.")
.optional(),
videoWall: z
.array(z.any())
.describe("If requestType is `get`, then this field will be populated with the video wall.")
.optional(),
uuid: z.string().describe("The uuid of the created video wall.").optional(),
});