Skip to main content
Glama
RhombusSystems

Rhombus MCP Server

Official
policy-alerts-tool.ts2.65 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { RequestModifiers } from "../util.js"; import { getExpiringPolicyAlerts, getPolicyAlerts } from "../api/policy-alerts-tool-api.js"; import { ApiPayloadSchema, OUTPUT_SCHEMA, TOOL_ARGS, type ToolArgs, } from "../types/policy-alerts-tool-types.js"; const TOOL_NAME = "policy-alerts-tool"; const TOOL_DESCRIPTION = ` Retrieves Rhombus policy alerts. Policy alerts in the Rhombus system are generated based on user-defined alert policies configured in the Rhombus Console. These policies trigger alerts when specific events occur, such as: * AI & Computer Vision Events: Based on intelligent video analytics for motion, people, vehicles, facial recognition, license plate recognition, or unusual behavior. * Device Status Changes: Like camera disconnections or sensor low battery. * Physical or Visual Tamper: Detection of physical movement of a device or obstruction of a camera's field of view. * Access Control Events: Such as unauthorized access attempts in restricted areas. Alerts are generated on triggers, but are NOT the same as notifications. Only certain alerts generate notifications based on user settings. Can inquire about labels that have been seen. Please note, this is not an exhaustive list, and there may be other types of triggers or events that generate policy alerts within the Rhombus system. This tool allows you to filter existing alerts by existing/expiring, a specific time range (before or after a timestamp in ISO 8601 format), by a list of device UUIDs, or by a list of location UUIDs. You can also specify the maximum number of results to return. The output is provided in JSON format.`; const TOOL_HANDLER = async (args: ToolArgs, extra: any) => { const payload = ApiPayloadSchema.parse(args); let ret; switch (args.queryType) { case "existing": ret = await getPolicyAlerts( payload, extra._meta?.requestModifiers as RequestModifiers, extra.sessionId ); break; case "expiringSoon": await getExpiringPolicyAlerts( payload, extra._meta?.requestModifiers as RequestModifiers, extra.sessionId ); break; default: throw new Error(`Unsupported queryType: ${args.queryType}`); } return { content: [{ type: "text" as const, text: JSON.stringify(ret) }], structuredContent: ret, }; }; export function createTool(server: McpServer) { server.registerTool( TOOL_NAME, { description: TOOL_DESCRIPTION, inputSchema: TOOL_ARGS, outputSchema: OUTPUT_SCHEMA.shape, }, TOOL_HANDLER ); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RhombusSystems/rhombus-node-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server