Skip to main content
Glama

unifi_protect_export_video

Read-only

Export recorded UniFi Protect camera footage over a specified time range to an MP4 file on disk, returning the file path. Use it to save video clips for review; ensure the camera was recording during that period.

Instructions

Export recorded footage from one camera over a time range as an MP4 file on disk. Always writes to a file and returns the path — video is never returned inline. Size grows quickly with the window: expect tens of megabytes per minute at full quality, and the call fails rather than exhausting memory if the export exceeds UNIFI_PROTECT_MAX_DOWNLOAD_BYTES. Footage only exists if the camera was recording at the time, so check the recording mode before concluding that nothing happened.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endYesEnd of the footage to export. Accepts ISO 8601 ("2026-08-29T22:00:00Z"), a relative expression ("2h ago", "30m", "7d"), or "now". Converted to the millisecond epoch the console requires — do not pass Unix seconds, which would silently query 1970 and return nothing.
startYesBeginning of the footage to export. Accepts ISO 8601 ("2026-08-29T22:00:00Z"), a relative expression ("2h ago", "30m", "7d"), or "now". Converted to the millisecond epoch the console requires — do not pass Unix seconds, which would silently query 1970 and return nothing.
channelNoEncoder channel: 0 is the high-quality stream, higher numbers are progressively lower bitrate. Use a higher channel to keep a long export manageable.
cameraIdYesCamera id — the `id` from unifi_protect_list_cameras, a 24-character hex string. Not the camera's name and not its MAC address.
savePathNoAbsolute path to write the MP4 to. Defaults to a timestamped file under UNIFI_PROTECT_SNAPSHOT_DIR. Parent directories are created.
Behavior5/5

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

The description discloses several behaviors beyond the readOnlyHint annotation: it always writes to disk, never returns video inline, grows tens of megabytes per minute, fails instead of exhausting memory when exceeding UNIFI_PROTECT_MAX_DOWNLOAD_BYTES, and may return nothing if the camera was not recording. This gives the agent concrete expectations and failure modes.

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?

Three focused sentences, with the core action front-loaded and no filler. Each sentence earns its place by covering purpose, output/scale behavior, failure mode, and a practical prerequisite.

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?

With no output schema, the description clearly explains what the tool returns (a file path), how large the output can get, when it fails, and a common reason for an empty result. Combined with the thorough input schema, an agent has everything needed to invoke it correctly.

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?

Schema description coverage is 100%, and the schema already documents parameter formats, defaults, and pitfalls (e.g., ISO 8601, relative expressions, not using Unix seconds). The tool description does not add additional parameter-level semantics beyond the schema, so the baseline of 3 applies.

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?

The description names a specific verb ('Export'), resource ('recorded footage from one camera over a time range'), and output ('MP4 file on disk'). It distinguishes this tool from siblings like get_camera_snapshot by emphasizing video export to a file, not inline or still images.

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

Usage Guidelines4/5

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

It gives clear context for when to use this tool: 'Always writes to a file and returns the path — video is never returned inline' implies this is the disk-export tool. It also advises checking the recording mode before interpreting an empty result. However, it does not explicitly name sibling alternatives or state when not to use it.

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

Install Server

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

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