Skip to main content
Glama

analyze_video

Detect visual anomalies in video files by computing surprise scores between frames. Returns anomaly windows and top timestamps for UI changes or video defects.

Instructions

Extract frames from a video file, run them through the ViT encoder, and compute frame-to-frame surprise scores. Returns timestamp array, surprise scores, z-score normalized scores, anomaly windows (>2σ spikes), and top N anomaly timestamps.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
top_nNoNumber of top anomaly timestamps to return (default 5).
video_pathYesPath to an mp4 or webm video file.
sigma_thresholdNoZ-score threshold to flag as anomaly window (default 2.0).
frame_sample_rateNoSample one frame every N seconds (default 1). Increase for long videos.
Behavior4/5

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

With no annotations, the description carries the full burden. It transparently describes the processing pipeline (frame extraction, ViT encoding, surprise computation) and explicitly lists returned outputs (timestamps, surprise scores, z-scores, anomaly windows, top N anomalies). This gives agents a clear picture of behavior beyond basic input/output.

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?

Two sentences, front-loaded with the primary action, and a compact list of return values. Every sentence contributes meaningful information without redundancy or filler.

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

Completeness3/5

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

The description explains return values, which is important given no output schema. However, it omits prerequisites or dependencies, such as whether a model must be loaded first (sibling load_model), and does not mention potential failure modes or performance caveats. This is a notable gap for a complex pipeline.

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 100%, so baseline is 3. The description adds value by linking 'top N anomaly timestamps' to top_n and '>2σ spikes' to sigma_threshold, reinforcing the schema's parameter descriptions. For instance, the anomaly window threshold is directly tied to sigma_threshold.

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 clearly states the action sequence: 'Extract frames from a video file, run them through the ViT encoder, and compute frame-to-frame surprise scores.' This specific verb+resource distinguishes it from siblings like analyze_screenshot (screenshots vs. video) and run_surprise_detection (generic detection vs. video-specific).

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

Usage Guidelines3/5

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

Usage is implied but not explicitly stated. The phrase 'from a video file' suggests it is for video anomaly detection, but there are no explicit when-to-use vs. alternatives or exclusions. Sibling tools like load_model and run_surprise_detection are not referenced.

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/Gonzih/lewm-mcp'

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