MCP 工具说明
更新时间:2026-06-30
本文件记录 DTS MCP 服务的连接方式和当前可用工具清单。工具清单通过 MCP tools/list 获取,服务端返回的服务信息为 bv-ai-gateway,版本 1.0.0。
基本信息
| 项目 | 说明 |
|---|---|
| MCP 地址 | http://192.168.100.56:18000/mcp |
| MCP 类型 | Streamable HTTP |
| 协议版本 | 服务端协商版本为 2025-03-26 |
| 鉴权方式 | 请求头 bv-api-key: <YOUR_API_KEY> |
| 工具数量 | 36 |
真实 API Key 属于敏感凭证,文档和前端代码中建议只保留占位符,通过服务端配置、环境变量或密钥管理系统注入。
连接流程
MCP Streamable HTTP 客户端通常按以下顺序连接:
- 向 MCP 地址发送
initialize请求。 - 从响应头读取
Mcp-Session-Id,后续请求都带上该会话 ID。 - 发送
notifications/initialized通知。 - 调用
tools/list获取工具列表。 - 调用
tools/call执行具体工具。
通用请求头
Content-Type: application/json
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2025-03-26
bv-api-key: <YOUR_API_KEY>
Mcp-Session-Id: <初始化响应返回的会话ID>
初始化请求第一次发送时不需要 Mcp-Session-Id。服务端可能返回普通 JSON,也可能返回 text/event-stream,客户端需要支持解析 SSE 中的 data: JSON 数据。
初始化示例
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-03-26",
"capabilities": {},
"clientInfo": {
"name": "dts-mcp-client",
"version": "1.0.0"
}
}
}
初始化成功后,服务端返回能力信息:
{
"protocolVersion": "2025-03-26",
"capabilities": {
"completions": {},
"logging": {},
"prompts": {
"listChanged": true
},
"resources": {
"subscribe": false,
"listChanged": true
},
"tools": {
"listChanged": true
}
},
"serverInfo": {
"name": "bv-ai-gateway",
"version": "1.0.0"
}
}
获取工具列表示例
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list",
"params": {}
}
如果响应中包含 nextCursor,需要继续带上该游标分页拉取。本次查询未返回 nextCursor。
调用工具示例
{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "devicePage",
"arguments": {
"currentPage": 1,
"pageSize": 10,
"productId": "产品编号"
}
}
}
所有工具的 inputSchema 均设置了 additionalProperties: false,调用时不要传入 schema 未声明的字段。
工具总览
| 分类 | 工具 |
|---|---|
| 场景与大屏操作 | switch_map、execute_label、execute_layout、execute_notifications、execute_highlight、execute_node、execute_patrol、executeCommand、filter_the_map_by_list_type |
| 项目、图层、节点、巡逻 | get_the_project_list、find_layer_node_resource、nodePage、nodeGetInfoByName、nodeGetInfoById、findPatrolPath |
| 产品、实体、产品Profile、服务 | productPage、productDetails、productFindFunctionList、productGetProfile、devicePage、deviceDetails、deviceAttribute、deviceEventDataSet、productServiceExecute |
| 通知消息 | find_notice_message、find_message_detail、send_comment |
| 孪生体、任务、时序 | twinsFindByName、twinsGet、taskPage、taskExecute、timeSeriesDataPage、timeSeriesDataGet |
| 通用辅助 | getCurrentDateTime、setAlarm、getTemperature |
工具明细
场景与大屏操作
| 工具名 | 功能 | 必填参数 | 可选参数 |
|---|---|---|---|
switch_map |
切换地图、切换场景 | name string:地图名称 |
AKA string:执行目标别名 |
execute_label |
操作标签 | executeAction string:执行动作,可选值包括打开、关闭、执行、飞行、切换、跳转、定位name string:标签名称 |
AKA string:执行目标别名 |
execute_layout |
操作布局、面板、看板、页面 | executeAction string:执行动作,可选值包括开启、关闭name string:布局名称 |
AKA string:执行目标别名 |
execute_notifications |
操作通知中心 | executeAction string:执行动作,可选值包括打开、关闭 |
AKA string:执行目标别名 |
execute_highlight |
操作高亮 | executeAction string:执行动作,可选值包括高亮、取消高亮、高亮所有、取消高亮所有、取消所有高亮name string:标签名称 |
AKA string:执行目标别名 |
execute_node |
操作地点、节点、位置 | executeAction string:执行动作,可选值包括飞行、切换、跳转、定位、移动name string:地点名称 |
AKA string:执行目标别名 |
execute_patrol |
操作巡逻、轮巡、巡查 | executeAction string:执行动作,可选值包括开启、关闭name string:巡逻名称 |
AKA string:执行目标别名 |
executeCommand |
执行动作以及命令式操作,例如打开通知中心、切换地图、开启轮巡等 | intent string:意图executeAction string:执行动作 |
AKA string:执行目标别名commandParams object:动作参数 |
filter_the_map_by_list_type |
按照列表或类型筛选地图 | flag integer:0 按地图列表筛选,1 按地图类型筛选guid string:项目编号 |
name string:地图名称 |
项目、图层、节点、巡逻
| 工具名 | 功能 | 必填参数 | 可选参数 |
|---|---|---|---|
get_the_project_list |
获取项目列表 | 无 | searchValue string:搜索内容 |
find_layer_node_resource |
获取指定项目的图层节点资源 | guid string:项目编号 |
layerType integer:图层类型,0 标签图层,1 矢量图层,2 模型图层,3 GIS 图层,4 特效图层,5 相机图层,6 单体化图层,7 扩展 SHP 图层searchName string:搜索名称 |
nodePage |
分页获取节点列表 | 无 | currentPage integer:当前页码,默认第一页pageSize integer:每页条数,默认 10 条nodeName string:节点名称nodeType string:节点类型projectGuid string:项目编号 |
nodeGetInfoByName |
根据名称获取节点信息 | nodeName string:节点名称 |
nodeType integer:节点类型projectGuid string:项目编号 |
nodeGetInfoById |
根据 ID 获取节点信息 | nodeId string:节点 ID |
无 |
findPatrolPath |
获取巡逻路径 | projectGuid string:项目编号 |
无 |
产品、实体、产品Profile、服务
| 工具名 | 功能 | 必填参数 | 可选参数 |
|---|---|---|---|
productPage |
分页获取产品列表 | 无 | currentPage integer:当前页码,默认第一页pageSize integer:每页条数,默认 10 条productName string:产品名称 |
productDetails |
获取产品详情 | productId string:产品编号 |
无 |
productFindFunctionList |
获取产品的功能列表 | productId string:产品编号 |
functionType integer:功能类型,0 属性,1 服务,2 事件 |
productGetProfile |
查看产品的产品 profile | productId string:产品编号 |
无 |
devicePage |
分页获取实体列表 | 无 | currentPage integer:当前页码,默认第一页pageSize integer:每页条数,默认 10 条productId string:产品编号deviceId string:实体编号deviceName string:实体名称 |
deviceDetails |
获取实体详情 | productId string:产品编号deviceId string:实体编号 |
无 |
deviceAttribute |
获取实体属性信息 | productId string:产品编号deviceId string:实体编号 |
无 |
deviceEventDataSet |
获取实体事件数据集,可按消息、产品、实体、事件标识组合查询最新事件信息 | 无 | messageId string:消息编号productId string:产品编号deviceId string:实体编号eventIdentifier string:事件标识符 |
productServiceExecute |
执行产品服务。建议先查询服务输入参数和服务标识符,再查询实体与属性,用属性值补齐服务入参 | productId string:产品编号serviceIdentifier string:服务标识符deviceId string:设备编号inputData object:输入参数,例如 { "identifier": "123" } |
无 |
通知消息
| 工具名 | 功能 | 必填参数 | 可选参数 |
|---|---|---|---|
find_notice_message |
获取通知消息列表 | startTime string:开始时间,格式 yyyy-MM-dd HH:mm:ssendTime string:结束时间,格式 yyyy-MM-dd HH:mm:ssprojectGuid string:项目编号 |
productIdList arraydeviceGuidList arrayintelligentSpacesIdList arrayeventIdList arraymessageType integer:0 正常,1 分享,2 上报,3 全部isRead integer:0 未读,1 已读,2 全部isComment integer:0 无评论,1 有评论,2 我评论,3 全部isWarn integer:0 一般消息,1 告警消息,2 全部isReply integer:0 不查看我回复,1 查看我回复isConfigTag integer:0 不查询无通知 Tag 的消息,1 查询无通知 Tag 的消息,2 全部tagIdList arraylastMessageTime string:上一个消息的发生时间searchValue string:搜索内容 |
find_message_detail |
获取通知消息详情 | messageId string:消息编号messageType integer:消息类型,0 正常,1 分享,2 上报projectGuid string:项目编号 |
userId integer:用户编号operateMessageId string:操作通知 ID |
send_comment |
针对通知发送一条评论 | messageId string:消息 ID |
commentContent string:评论内容 |
孪生体、任务、时序
| 工具名 | 功能 | 必填参数 | 可选参数 |
|---|---|---|---|
twinsFindByName |
根据名称模糊搜索孪生体 | intelligentSpacesName string:孪生体名称 |
无 |
twinsGet |
获取孪生体及关联资源 | 无 | intelligentSpacesId string:孪生体编号intelligentSpacesJointId string:关联编号,获取项目孪生体时通常需要applicationProgramId string:应用程序编号,获取项目孪生体时通常需要,用于判断设备孪生体资源权限 |
taskPage |
分页获取任务列表 | 无 | currentPage integer:当前页码,默认第一页pageSize integer:每页条数,默认 10 条ruleName string:规则名称 |
taskExecute |
执行任务,只能执行 operatingStatus 为 1 的任务 |
ruleId string:规则编号 |
无 |
timeSeriesDataPage |
分页获取可用的时序数据模板列表。返回结果中的 request 字段可用于后续查询具体时序数据记录 |
无 | currentPage integer:当前页码,默认第一页pageSize integer:每页条数,默认 10 条,设置为 -1 表示返回所有数据tsName string:用于模糊匹配的时序数据名称 |
timeSeriesDataGet |
在没有明确请求参数时,优先用于获取时序结果集 | templateName string:时序名称 |
无 |
通用辅助
| 工具名 | 功能 | 必填参数 | 可选参数 |
|---|---|---|---|
getCurrentDateTime |
获取用户时区的当前日期和时间 | 无 | 无 |
setAlarm |
为指定时间设置用户提醒 | time string:ISO-8601 格式时间 |
无 |
getTemperature |
获取特定位置的温度,单位为摄氏度 | 无 | latitude number:纬度longitude number:经度 |
常见调用路径
查询并调用产品服务
- 用
productPage或已知产品编号确定productId。 - 用
productFindFunctionList查询服务列表,取服务标识符serviceIdentifier。 - 用
devicePage查询实体,确定deviceId。 - 如需补齐入参,用
deviceAttribute查询实体属性。 - 用
productServiceExecute执行服务。
查询通知并评论
- 用
find_notice_message按项目和时间范围查询通知列表。 - 用
find_message_detail查看通知详情。 - 用
send_comment对通知发送评论。
控制大屏场景
- 用
get_the_project_list确定项目。 - 用
switch_map切换地图或场景。 - 用
execute_label、execute_node、execute_layout、execute_patrol等工具执行具体动作。 - 复杂自然语言命令可统一走
executeCommand,由服务端按intent、executeAction、commandParams解释执行。
对接注意事项
- 所有时间字段建议使用服务端要求的格式;通知消息列表中的
startTime、endTime为yyyy-MM-dd HH:mm:ss。 - 分页接口未传
currentPage、pageSize时,按工具说明使用默认第一页和默认 10 条。 - 枚举值请按工具描述传入,避免传中文说明文本代替枚举数字。
inputData、commandParams等对象型参数应传 JSON 对象,不要传 JSON 字符串。- 执行型工具会改变大屏、任务或设备服务状态,生产环境接入前建议先做权限隔离和操作确认。
作者:北京-产品-yantings 创建时间:2026-07-01 09:55
最后编辑:北京-产品-yantings 更新时间:2026-07-07 18:14
最后编辑:北京-产品-yantings 更新时间:2026-07-07 18:14