Skip to main content
Glama

get_motion_events

Read-only

Retrieve recent UniFi Protect camera motion events with camera names and timestamps. Filter by camera or lookback window to review raw motion activity.

Instructions

Return recent camera motion events, resolved to camera names and timestamps.

Read-only operation: it queries Protect motion events over the lookback window, maps each event to its camera name and a human-readable timestamp, and returns the count and per-event list. Requires Protect username/password credentials configured for the console. Use get_smart_detections instead when you need AI classification (person/vehicle/animal/package) rather than raw motion; use get_protect_event_summary for aggregate counts.

Args: hours: Lookback window in hours from now (default 24). limit: Maximum number of events to return (default 50). camera_id: Optional Protect camera identifier or name to filter events to one camera; omit for all cameras. device: Optional Protect console name to target a specific UniFi Protect device; omit to use the first Protect-enabled device.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hoursNoLookback window in hours from now (default 24).
limitNoMaximum number of events to return (default 50).
deviceNoOptional Protect console name to target a specific UniFi Protect device; omit to use the first Protect-enabled device.
camera_idNoOptional Protect camera identifier or name to filter events to one camera; omit for all cameras.
Install Server

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The readOnlyHint annotation already marks it read-only, and the description reinforces the read-only nature while adding genuine behavioral detail: it queries Protect events, maps them to camera names/human-readable timestamps, returns count and per-event list, and requires Protect credentials. This goes beyond annotation-only information.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded, followed by concise read-only/requirements/alternatives and a compact Args block. No filler; each section contributes.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only query with no output schema, the description tells the agent what it will get (count and per-event list with camera name/timestamp), how to constrain results, and which credential prerequisites exist. That is sufficient to invoke and interpret the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema already covers all four parameters with the same descriptions and defaults, so the description adds no new meaning for hours, limit, camera_id, or device. The Args section is useful for visibility but not semantically additive beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and resource: 'Return recent camera motion events, resolved to camera names and timestamps.' It also names sibling alternatives, immediately distinguishing this tool from get_smart_detections and get_protect_event_summary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use alternatives: get_smart_detections for AI classification, get_protect_event_summary for aggregate counts. Also gives the lookback-window context and required credentials, making the selection criteria clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Other Tools

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/mikeholownych/unifi-mcp'

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