Skip to main content
Glama

analyze_stream

Probes an RTSP stream or local file to retrieve width, height, and fps, and generates a candidate test case list. Optionally accepts per-frame annotations to include discovered labels.

Instructions

v1.1.0 — Edge AI version of analyze_url / analyze_screen. Probes an RTSP stream (or a file path destined for local mediamtx) and returns basic geometry (width / height / fps) plus a candidate_tcs list. When an annotations sidecar (JSON: per-frame expected detections) is supplied, candidate_tcs gets one entry per discovered label PLUS four runner-standard entries (throughput, latency SLA, reconnect, empty-frame). Strings only — same schema parity as analyze_url's candidate_tcs.

Vendor-host blacklist (default-on): refuses RTSP URLs at known surveillance / IoT camera vendor domains (Dahua / Hikvision / etc.) to keep accidental probing of public camera feeds off the default path. Set QA_EDGE_ALLOW_VENDOR_HOSTS=true to opt out for own-camera testing.

Requires the [edge] extras (pip install "mk-qa-master[edge]") — opencv-python is the probe driver. Tool returns {error: missing_extras, hint} when the extras aren't installed.

Returns on success: {url, width, height, fps, labels, candidate_tcs}. Returns on rejection: {error: bad_request | forbidden_vendor_host | missing_extras | stream_unreachable, hint, ...}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rtsp_urlYesRequired. The stream to probe. Either an `rtsp://...` URL or a file path that the EdgeInferenceRunner will serve via mediamtx + ffmpeg at setup time.
annotations_pathNoOptional. JSON sidecar with per-frame expected detections (format: {fps, frames: {frame_idx: [{label, bbox}, ...]}}). When supplied, candidate_tcs lists one entry per discovered label. Missing / malformed files are non-fatal — the tool falls back to label-free candidates.
Behavior5/5

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

With no annotations, the description fully discloses behavior: vendor host blacklist, opt-out via env var, extra requirement, error returns, non-fatal missing annotations, and return structures for success and rejection.

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?

Description is front-loaded with version and summary, then logically organizes details about return structure, restrictions, requirements, and error returns. Every sentence adds value without redundancy.

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?

Given two parameters and no output schema, the description comprehensively covers input semantics, return structures for all outcomes (success, error types), and edge cases (missing extras, vendor host blacklist, malformed annotations).

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

Parameters5/5

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

Schema already has descriptions, but the description adds significant context: for rtsp_url it explains file path likely served via mediamtx, for annotations_path it details format and fallback behavior. This goes 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?

The description clearly states the tool's purpose: probing an RTSP stream or file path for geometry and candidate_tcs, with explicit comparison to siblings analyze_url and analyze_screen. The verb 'probes' and output listing make it unambiguous.

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?

Provides use context (Edge AI), requirements (extras), and restrictions (vendor host blacklist with opt-out). It does not explicitly state when not to use compared to siblings, but the comparison to analyze_url and analyze_screen implies alternatives.

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/kao273183/mk-qa-master'

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