video-analytics
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVideo Analytics (VA-MCP)
视频分析(VA-MCP)
Queries incidents, alerts, and metrics stored in Elasticsearch via MCP JSON-RPC at port 9901.
ALWAYS run the commands below yourself and relay results to the user. Do NOT guess or describe — actually execute and report back.
通过MCP JSON-RPC(端口9901)查询存储在Elasticsearch中的事件、警报和指标。
请务必自行运行以下命令并将结果反馈给用户。请勿猜测或描述——实际执行后再汇报结果。
Deployment prerequisite
部署前提条件
This skill reads from the Elasticsearch/VA-MCP stack brought up by the VSS alerts profile (either or mode). Before any query:
verificationreal-time-
Probe the VA-MCP endpoint:bash
curl -sf --max-time 5 "http://${HOST_IP}:9901/mcp" >/dev/null 2>&1 || \ curl -sf --max-time 5 "http://${HOST_IP}:9901/" >/dev/null -
If the probe fails, ask the user:"The VSSprofile isn't running on
alerts(VA-MCP unreachable). Which mode should I deploy —$HOST_IP(CV) orverification(VLM)?"real-time- Answer → hand off to the skill with
/deploy. Return here once it succeeds.-p alerts -m <mode> - If the user declines → stop. No incidents/alerts/metrics to query without the alerts stack up.
(If your caller has granted explicit pre-authorization to deploy autonomously — e.g. the request says "pre-authorized to deploy prerequisites", or you are running in a non-interactive evaluation harness with that permission — skip the confirmation and invokedirectly. Default the mode to/deployunless the request specifies otherwise.)verification - Answer → hand off to the
-
If the probe passes, proceed.
本技能读取由VSS 配置文件(或模式)启动的Elasticsearch/VA-MCP堆栈中的数据。查询前请先完成以下步骤:
alertsverificationreal-time-
探测VA-MCP端点:bash
curl -sf --max-time 5 "http://${HOST_IP}:9901/mcp" >/dev/null 2>&1 || \ curl -sf --max-time 5 "http://${HOST_IP}:9901/" >/dev/null -
如果探测失败,请询问用户:"VSS配置文件未在
alerts上运行(VA-MCP无法访问)。我应该部署哪种模式——$HOST_IP(CV)还是verification(VLM)?"real-time- 用户答复后 → 将任务转交给技能,参数为
/deploy。部署成功后再返回此处。-p alerts -m <mode> - 如果用户拒绝 → 停止操作。没有运行的alerts堆栈则无法查询事件/警报/指标。
(如果调用者已明确授权自主部署——例如请求中注明"已预先授权部署前提条件",或您在具备该权限的非交互式评估环境中运行——则无需确认,直接调用。默认模式为/deploy,除非请求中另有指定。)verification - 用户答复后 → 将任务转交给
-
如果探测成功,继续执行后续步骤。
REQUIRED: Two-Step Pattern (copy this exactly)
必填:两步式流程(严格照搬此步骤)
Every query requires two shell commands run in sequence:
bash
undefined每次查询都需要按顺序运行以下两条shell命令:
bash
undefinedStep 1: initialize — get session ID from response HEADER
步骤1:初始化——从响应HEADER中获取会话ID
SESSION_ID=$(curl -si -X POST http://localhost:9901/mcp
-H "Content-Type: application/json"
-H "Accept: application/json, text/event-stream"
-d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"cli","version":"1.0"}},"id":0}'
| grep -i "mcp-session-id" | awk '{print $2}' | tr -d '\r')
-H "Content-Type: application/json"
-H "Accept: application/json, text/event-stream"
-d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"cli","version":"1.0"}},"id":0}'
| grep -i "mcp-session-id" | awk '{print $2}' | tr -d '\r')
SESSION_ID=$(curl -si -X POST http://localhost:9901/mcp
-H "Content-Type: application/json"
-H "Accept: application/json, text/event-stream"
-d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"cli","version":"1.0"}},"id":0}'
| grep -i "mcp-session-id" | awk '{print $2}' | tr -d '\r')
-H "Content-Type: application/json"
-H "Accept: application/json, text/event-stream"
-d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"cli","version":"1.0"}},"id":0}'
| grep -i "mcp-session-id" | awk '{print $2}' | tr -d '\r')
Step 2: call the tool using the session ID in the header
步骤2:使用请求头中的会话ID调用工具
curl -s -X POST http://localhost:9901/mcp
-H "Content-Type: application/json"
-H "Accept: application/json, text/event-stream"
-H "mcp-session-id: $SESSION_ID"
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_incidents","arguments":{"max_count":10}},"id":1}'
| grep '^data:' | sed 's/^data: //' | jq -r '.result.content[0].text'
-H "Content-Type: application/json"
-H "Accept: application/json, text/event-stream"
-H "mcp-session-id: $SESSION_ID"
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_incidents","arguments":{"max_count":10}},"id":1}'
| grep '^data:' | sed 's/^data: //' | jq -r '.result.content[0].text'
> The session ID comes from the **response header** `mcp-session-id`, not the body.
> Skipping Step 1 always results in `Bad Request: Missing session ID`.
---curl -s -X POST http://localhost:9901/mcp
-H "Content-Type: application/json"
-H "Accept: application/json, text/event-stream"
-H "mcp-session-id: $SESSION_ID"
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_incidents","arguments":{"max_count":10}},"id":1}'
| grep '^data:' | sed 's/^data: //' | jq -r '.result.content[0].text'
-H "Content-Type: application/json"
-H "Accept: application/json, text/event-stream"
-H "mcp-session-id: $SESSION_ID"
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_incidents","arguments":{"max_count":10}},"id":1}'
| grep '^data:' | sed 's/^data: //' | jq -r '.result.content[0].text'
> 会话ID来自响应头`mcp-session-id`,而非响应体。
> 跳过步骤1总会导致`Bad Request: Missing session ID`错误。
---Tool Reference
工具参考
Replace the payload in Step 2 with any of the following.
-d将步骤2中的负载替换为以下任意一种即可。
-dvideo_analytics__get_incidents
video_analytics__get_incidents
| Parameter | Type | Description |
|---|---|---|
| string | Sensor ID or place name (optional) |
| string | |
| string | ISO 8601: |
| string | ISO 8601 |
| int | Max results (default: 10) |
| list | Extra fields: |
| string | |
bash
undefined| 参数 | 类型 | 描述 |
|---|---|---|
| 字符串 | 传感器ID或地点名称(可选) |
| 字符串 | |
| 字符串 | ISO 8601格式: |
| 字符串 | ISO 8601格式 |
| 整数 | 最大结果数(默认值:10) |
| 列表 | 额外字段: |
| 字符串 | |
bash
undefinedRecent incidents (all sensors)
近期事件(所有传感器)
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_incidents","arguments":{"max_count":10}},"id":1}'
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_incidents","arguments":{"max_count":10}},"id":1}'
For a specific sensor
指定传感器的事件
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_incidents","arguments":{"source":"<sensor-id>","source_type":"sensor","max_count":20}},"id":1}'
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_incidents","arguments":{"source":"<sensor-id>","source_type":"sensor","max_count":20}},"id":1}'
Confirmed (VLM-verified) only
仅已确认(VLM验证)的事件
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_incidents","arguments":{"vlm_verdict":"confirmed","max_count":10}},"id":1}'
undefined-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_incidents","arguments":{"vlm_verdict":"confirmed","max_count":10}},"id":1}'
undefinedvideo_analytics__get_incident
video_analytics__get_incident
bash
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_incident","arguments":{"id":"<incident-id>","includes":["objectIds","info"]}},"id":1}'bash
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_incident","arguments":{"id":"<incident-id>","includes":["objectIds","info"]}},"id":1}'video_analytics__get_sensor_ids
video_analytics__get_sensor_ids
bash
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_sensor_ids","arguments":{}},"id":1}'bash
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_sensor_ids","arguments":{}},"id":1}'video_analytics__get_places
video_analytics__get_places
bash
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_places","arguments":{}},"id":1}'bash
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_places","arguments":{}},"id":1}'video_analytics__get_fov_histogram
video_analytics__get_fov_histogram
bash
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_fov_histogram","arguments":{"source":"<sensor-id>","source_type":"sensor","start_time":"<ISO>","end_time":"<ISO>","object_type":"Person","bucket_count":10}},"id":1}'bash
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__get_fov_histogram","arguments":{"source":"<sensor-id>","source_type":"sensor","start_time":"<ISO>","end_time":"<ISO>","object_type":"Person","bucket_count":10}},"id":1}'video_analytics__analyze
video_analytics__analyze
analysis_typemax_min_incidentsaverage_speedavg_num_peopleavg_num_vehiclesbash
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__analyze","arguments":{"source":"<sensor-id>","source_type":"sensor","start_time":"<ISO>","end_time":"<ISO>","analysis_type":"avg_num_people"}},"id":1}'analysis_typemax_min_incidentsaverage_speedavg_num_peopleavg_num_vehiclesbash
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"video_analytics__analyze","arguments":{"source":"<sensor-id>","source_type":"sensor","start_time":"<ISO>","end_time":"<ISO>","analysis_type":"avg_num_people"}},"id":1}'vst_sensor_list
vst_sensor_list
bash
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"vst_sensor_list","arguments":{}},"id":1}'bash
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"vst_sensor_list","arguments":{}},"id":1}'