rhombus-node-mcp
Version:
MCP server for Rhombus API
29 lines (28 loc) • 1.21 kB
JavaScript
import { z } from "zod";
import { createUuidSchema } from "../types.js";
import DeviceType from "./deviceType.js";
import { TempUnit } from "../utils/temp.js";
const filterByObjectSchema = z.object({
locationUuids: z
.array(createUuidSchema())
.nullish()
.describe("The UUIDs of the locations to filter by. Set to null or an empty array to not filter by location."),
});
export const TOOL_ARGS = {
entityTypes: z
.array(z.nativeEnum(DeviceType).describe("The entity type to retreive"))
.describe("What type of entities to retrieve."),
filterBy: z
.union([filterByObjectSchema, z.null()])
.optional()
.transform((v) => v ?? { locationUuids: null })
.describe("Additional filters that can be applied to the result. Omit or pass null for no filtering."),
timeZone: z
.string()
.describe("The timezone for formatting timestamps. This is necessary for the tool to produce accurate formatted timestamps."),
tempUnit: z
.nativeEnum(TempUnit)
.nullable()
.describe("The unit of temperature to return, if applicable. Default is Celsius."),
};
const TOOL_ARGS_SCHEMA = z.object(TOOL_ARGS);