Skip to main content
Glama

nvr_export_clip

Export a recorded NVR time window to an MP4 clip. Optionally re-encode to fit a target file size, with lossless copy by default.

Instructions

Export a replay window (ISO-8601 start/end, UTC offset required) to an mp4 in the export dir. By default uses ffmpeg -c copy (lossless). Writes to local disk, so it is gated like a write: VIGI_NVR_ALLOW_WRITES=true AND confirm_write=true. VIGI_NVR_DRY_RUN returns the argv with the URL redacted. Window <= VIGI_NVR_EXPORT_MAX_MINUTES. Set target_max_mb (e.g. 20 for Gmail) and/or max_width to re-encode with libx264 (CRF/scale chosen from duration and target) so the file fits; then also returns original_bytes, encoded_bytes and fits_target. Returns path, bytes, duration_s, sha256 and a redacted ffmpeg stderr tail. An empty window surfaces as NO_FOOTAGE_IN_WINDOW.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endYes
startYes
streamNo
channelYes
max_widthNo
confirm_writeNoMust be the JSON boolean true to authorise this mutating write. A string such as "true"/"1"/"yes" does NOT count and the write is refused with no network call; re-send with the boolean confirm_write=true after confirming the change with the operator.
target_max_mbNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and delivers: write gating with two required flags, dry-run argv behavior with URL redaction, the lossless ffmpeg -c copy default, the libx264 re-encode path when target_max_mb/max_width are set, extra return fields (original_bytes, encoded_bytes, fits_target) and the NO_FOOTAGE_IN_WINDOW error surface.

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

Conciseness4/5

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

Dense but front-loaded: the core action and output artifact come first, then gating, then the optional re-encode behavior and return values. Nearly every clause carries operational information, though the run-on packaging of dry-run, encoding and return fields could be tightened.

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 mutating export tool with no annotations, the description covers gating, dry-run, duration limits, re-encode triggers and error codes; return values are spelled out even though an output schema exists. An agent has everything needed to invoke it correctly and interpret the result.

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

Parameters4/5

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

Schema coverage is only 14% (just confirm_write), so the description must compensate and largely does: start/end are ISO-8601 with a required UTC offset, target_max_mb is illustrated ('e.g. 20 for Gmail'), max_width triggers re-encoding, and confirm_write semantics are covered in both places. channel and stream are left to inference, which keeps it below a 5.

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?

States a specific verb and resource ('Export a replay window ... to an mp4 in the export dir') with the scope (start/end window) and output artifact. It is clearly distinguishable from sibling read tools like nvr_snapshot, nvr_get_export and nvr_list_exports without opening any schema.

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?

Gives strong when-to-use context: it is gated like a write (VIGI_NVR_ALLOW_WRITES=true AND confirm_write=true), VIGI_NVR_DRY_RUN previews the argv, and the window is bounded by VIGI_NVR_EXPORT_MAX_MINUTES. It does not explicitly name when to prefer a sibling (e.g. nvr_snapshot or nvr_sample_frames) over exporting a clip, so it stops short of full alternative routing.

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