MCP 历史工具设计(未公开)
保留的 MCP 工具设计草案,不代表 RailWise 已对外提供任何工具、参数或返回数据。
RailWise MCP Server 工具列表
Section titled “RailWise MCP Server 工具列表”1. 工具概述
Section titled “1. 工具概述”RailWise MCP Server 目前提供 12 个工具,分为四大类别:
| 类别 | 工具数量 | 说明 |
|---|---|---|
| 数据查询 | 4 个 | 监测数据、项目信息、设备状态、历史记录查询 |
| 计算分析 | 3 个 | 坐标转换、平差计算、变形分析 |
| 项目管理 | 3 个 | 项目查询、测点管理、任务调度 |
| 系统管理 | 2 个 | 用户权限、系统状态查询 |
所有工具均遵循 MCP 协议规范,使用 JSON Schema 定义参数和返回值结构。
2. 数据查询工具
Section titled “2. 数据查询工具”2.1 railwise_query_monitoring_data — 查询监测数据
Section titled “2.1 railwise_query_monitoring_data — 查询监测数据”查询全站仪自动化监测系统的实时或历史监测数据。
参数定义:
{ "type": "object", "properties": { "project_id": { "type": "string", "description": "项目唯一标识符", "pattern": "^PRJ-[A-Z0-9]{8}$" }, "point_ids": { "type": "array", "items": { "type": "string" }, "description": "测点ID列表,为空则查询所有测点" }, "data_type": { "type": "string", "enum": ["settlement", "displacement", "convergence", "stress", "all"], "description": "数据类型:沉降、位移、收敛、应力、全部" }, "start_time": { "type": "string", "format": "date-time", "description": "查询起始时间,ISO 8601 格式" }, "end_time": { "type": "string", "format": "date-time", "description": "查询结束时间,ISO 8601 格式" }, "aggregation": { "type": "string", "enum": ["raw", "hourly", "daily", "weekly"], "description": "数据聚合方式", "default": "raw" }, "limit": { "type": "integer", "minimum": 1, "maximum": 10000, "description": "返回记录数量上限", "default": 1000 } }, "required": ["project_id", "start_time", "end_time"]}返回值结构:
{ "project_id": "PRJ-A1B2C3D4", "data_type": "settlement", "time_range": { "start": "2025-01-10T00:00:00Z", "end": "2025-01-15T23:59:59Z" }, "total_records": 1248, "points": [ { "point_id": "PT-001", "point_name": "K3+520-左线-1", "point_type": "settlement", "records": [ { "timestamp": "2025-01-15T08:00:00Z", "value": -12.3, "unit": "mm", "change_rate": -0.8, "warning_level": "orange", "status": "normal" } ] } ], "summary": { "normal_count": 1240, "yellow_warning_count": 6, "orange_warning_count": 2, "red_warning_count": 0 }}使用示例:
// AI 助手调用示例{ "name": "railwise_query_monitoring_data", "arguments": { "project_id": "PRJ-A1B2C3D4", "data_type": "settlement", "start_time": "2025-01-14T00:00:00Z", "end_time": "2025-01-15T23:59:59Z", "aggregation": "hourly", "limit": 500 }}2.2 railwise_query_project_info — 查询项目信息
Section titled “2.2 railwise_query_project_info — 查询项目信息”查询监测项目的基本信息、测点配置和监测方案。
参数定义:
{ "type": "object", "properties": { "project_id": { "type": "string", "description": "项目唯一标识符" }, "include_points": { "type": "boolean", "description": "是否包含测点详情", "default": true }, "include_devices": { "type": "boolean", "description": "是否包含设备信息", "default": false } }, "required": ["project_id"]}返回值结构:
{ "project_id": "PRJ-A1B2C3D4", "project_name": "宁波地铁3号线控制保护区监测", "project_type": "subway_protection", "status": "active", "location": { "province": "浙江省", "city": "宁波市", "district": "鄞州区" }, "client": "宁波市轨道交通集团", "contractor": "中铁一局", "monitor_unit": "宁波睿威工程技术有限公司", "start_date": "2024-06-01", "expected_end_date": "2025-12-31", "points": [ { "point_id": "PT-001", "point_name": "K3+520-左线-1", "point_type": "settlement", "coordinate": { "x": 384567.123, "y": 3156784.456, "z": 12.345 }, "warning_threshold": { "yellow": -10.0, "orange": -15.0, "red": -20.0 } } ], "monitoring_scheme": { "frequency": "4h", "instrument": "total_station", "data_retention_days": 365 }}2.3 railwise_query_device_status — 查询设备状态
Section titled “2.3 railwise_query_device_status — 查询设备状态”查询全站仪等监测设备的实时状态和运行信息。
参数定义:
{ "type": "object", "properties": { "project_id": { "type": "string", "description": "项目ID,为空则查询所有可访问设备" }, "device_ids": { "type": "array", "items": { "type": "string" }, "description": "设备ID列表" } }}返回值结构:
{ "devices": [ { "device_id": "DEV-TS-001", "device_name": "全站仪-01", "device_type": "total_station", "model": "Leica TS16", "status": "online", "last_online": "2025-01-15T14:30:00Z", "project_id": "PRJ-A1B2C3D4", "location": "K3+520控制点", "battery_level": 78, "temperature": 15.2, "last_measurement": "2025-01-15T14:00:00Z", "measurement_count_today": 36, "firmware_version": "2.5.1" } ], "summary": { "total": 5, "online": 4, "offline": 1, "warning": 0 }}2.4 railwise_query_measurement_history — 查询测量历史
Section titled “2.4 railwise_query_measurement_history — 查询测量历史”查询特定测点的详细测量历史记录,包括原始观测数据。
参数定义:
{ "type": "object", "properties": { "point_id": { "type": "string", "description": "测点ID" }, "start_time": { "type": "string", "format": "date-time" }, "end_time": { "type": "string", "format": "date-time" }, "include_raw": { "type": "boolean", "description": "是否包含原始观测数据", "default": false } }, "required": ["point_id", "start_time", "end_time"]}3. 计算分析工具
Section titled “3. 计算分析工具”3.1 railwise_coordinate_transform — 坐标转换
Section titled “3.1 railwise_coordinate_transform — 坐标转换”执行不同坐标系之间的坐标转换,支持常见的工程测量坐标转换需求。
参数定义:
{ "type": "object", "properties": { "coordinates": { "type": "array", "items": { "type": "object", "properties": { "x": { "type": "number" }, "y": { "type": "number" }, "z": { "type": "number" } }, "required": ["x", "y"] }, "description": "待转换的坐标列表" }, "source_crs": { "type": "string", "description": "源坐标系代码", "enum": ["CGCS2000", "WGS84", "Beijing54", "Xian80", "local"] }, "target_crs": { "type": "string", "description": "目标坐标系代码", "enum": ["CGCS2000", "WGS84", "Beijing54", "Xian80", "local"] }, "transform_method": { "type": "string", "description": "转换方法", "enum": ["three_parameter", "seven_parameter", "grid", "custom"], "default": "seven_parameter" }, "transform_params": { "type": "object", "description": "转换参数(当使用自定义转换时)" } }, "required": ["coordinates", "source_crs", "target_crs"]}返回值结构:
{ "transform_id": "TRF-20250115-001", "source_crs": "CGCS2000", "target_crs": "local", "transform_method": "seven_parameter", "results": [ { "source": { "x": 384567.123, "y": 3156784.456, "z": 12.345 }, "target": { "x": 1000.000, "y": 2000.000, "z": 12.345 }, "residual": { "dx": 0.002, "dy": 0.001, "dz": 0.000 } } ], "statistics": { "point_count": 1, "max_residual": 0.002, "rms": 0.0015 }}3.2 railwise_adjustment_compute — 平差计算
Section titled “3.2 railwise_adjustment_compute — 平差计算”执行测量平差计算,支持条件平差、间接平差等多种平差模型。
参数定义:
{ "type": "object", "properties": { "adjustment_type": { "type": "string", "enum": ["indirect", "conditional", "indirect_with_constraints"], "description": "平差类型" }, "observations": { "type": "array", "items": { "type": "object", "properties": { "obs_id": { "type": "string" }, "obs_type": { "type": "string", "enum": ["distance", "angle", "elevation", "coordinate"] }, "value": { "type": "number" }, "precision": { "type": "number", "description": "观测精度(中误差)" } } } }, "unknowns": { "type": "array", "items": { "type": "object", "properties": { "unknown_id": { "type": "string" }, "unknown_type": { "type": "string", "enum": ["coordinate", "orientation", "parameter"] }, "approximate_value": { "type": "number" } } } } }, "required": ["adjustment_type", "observations", "unknowns"]}3.3 railwise_deformation_analysis — 变形分析
Section titled “3.3 railwise_deformation_analysis — 变形分析”对监测数据进行变形分析,计算累计变形量、变化速率、趋势预测等。
参数定义:
{ "type": "object", "properties": { "point_id": { "type": "string", "description": "测点ID" }, "analysis_type": { "type": "string", "enum": ["cumulative", "rate", "trend", "forecast", "comprehensive"], "description": "分析类型" }, "start_time": { "type": "string", "format": "date-time" }, "end_time": { "type": "string", "format": "date-time" }, "forecast_days": { "type": "integer", "description": "预测天数(当 analysis_type 为 forecast 时)", "default": 7 } }, "required": ["point_id", "analysis_type", "start_time", "end_time"]}返回值结构(综合分析):
{ "point_id": "PT-001", "analysis_type": "comprehensive", "time_range": { "start": "2024-06-01T00:00:00Z", "end": "2025-01-15T23:59:59Z" }, "cumulative_deformation": { "max_value": -12.3, "min_value": -0.5, "current_value": -12.3, "unit": "mm" }, "deformation_rate": { "current_rate": -0.8, "average_rate": -0.5, "max_rate": -1.2, "unit": "mm/day" }, "trend": { "direction": "settling", "stability": "unstable", "confidence": 0.85 }, "forecast": { "forecast_days": 7, "predicted_value": -14.1, "confidence_interval": { "lower": -15.5, "upper": -12.7 } }, "warning_assessment": { "current_level": "orange", "trend_level": "red", "recommendation": "建议加密监测频率至2小时/次,并启动现场巡查" }}4. 项目管理工具
Section titled “4. 项目管理工具”4.1 railwise_list_projects — 列出项目
Section titled “4.1 railwise_list_projects — 列出项目”列出当前用户有权限访问的监测项目列表。
参数定义:
{ "type": "object", "properties": { "status": { "type": "string", "enum": ["active", "paused", "completed", "all"], "default": "active" }, "limit": { "type": "integer", "default": 50, "maximum": 200 } }}4.2 railwise_query_point_details — 查询测点详情
Section titled “4.2 railwise_query_point_details — 查询测点详情”查询特定测点的详细配置信息和历史状态。
参数定义:
{ "type": "object", "properties": { "point_id": { "type": "string", "description": "测点ID" } }, "required": ["point_id"]}4.3 railwise_query_task_schedule — 查询任务调度
Section titled “4.3 railwise_query_task_schedule — 查询任务调度”查询监测任务的调度计划和执行状态。
参数定义:
{ "type": "object", "properties": { "project_id": { "type": "string" }, "date": { "type": "string", "format": "date", "description": "查询日期,默认为今天" } }, "required": ["project_id"]}5. 系统管理工具
Section titled “5. 系统管理工具”5.1 railwise_query_user_permissions — 查询用户权限
Section titled “5.1 railwise_query_user_permissions — 查询用户权限”查询当前 API Key 的权限范围和访问限制。
参数定义:
{ "type": "object", "properties": {}}返回值结构:
{ "api_key_id": "KEY-xxxxxxxx", "key_name": "Claude Desktop 集成", "permissions": { "data_read": true, "data_write": false, "project_read": true, "project_write": false, "device_read": true, "device_control": false, "compute": true, "admin": false }, "accessible_projects": ["PRJ-A1B2C3D4", "PRJ-E5F6G7H8"], "rate_limit": { "requests_per_minute": 60, "requests_per_hour": 1000, "requests_per_day": 10000 }, "expires_at": "2025-12-31T23:59:59Z"}5.2 railwise_query_system_status — 查询系统状态
Section titled “5.2 railwise_query_system_status — 查询系统状态”查询 RailWise 系统的整体运行状态和健康信息。
参数定义:
{ "type": "object", "properties": {}}返回值结构:
{ "system_status": "healthy", "version": "2.5.1", "services": { "api_gateway": { "status": "online", "latency_ms": 45 }, "data_service": { "status": "online", "latency_ms": 120 }, "compute_service": { "status": "online", "latency_ms": 80 }, "device_service": { "status": "online", "latency_ms": 200 } }, "statistics": { "active_projects": 156, "online_devices": 423, "today_measurements": 125840 }}6. 工具调用完整示例
Section titled “6. 工具调用完整示例”以下是一个典型的 AI 助手与 RailWise MCP Server 的交互流程:
6.1 用户请求
Section titled “6.1 用户请求”用户:请分析宁波地铁3号线 K3+520 断面左线1号测点最近一周的沉降趋势,并预测未来3天的变化。
6.2 AI 助手工具调用序列
Section titled “6.2 AI 助手工具调用序列”Step 1: 查询项目信息(确认项目ID)┌────────────────────────────────────────┐│ Tool: railwise_list_projects ││ Arguments: { "status": "active" } │└────────────────────────────────────────┘
Step 2: 查询测点详情(确认测点ID)┌────────────────────────────────────────┐│ Tool: railwise_query_project_info ││ Arguments: { ││ "project_id": "PRJ-A1B2C3D4", ││ "include_points": true ││ } │└────────────────────────────────────────┘
Step 3: 执行变形分析┌────────────────────────────────────────┐│ Tool: railwise_deformation_analysis ││ Arguments: { ││ "point_id": "PT-001", ││ "analysis_type": "comprehensive", ││ "start_time": "2025-01-08T00:00:00Z",││ "end_time": "2025-01-15T23:59:59Z", ││ "forecast_days": 3 ││ } │└────────────────────────────────────────┘6.3 AI 助手回复
Section titled “6.3 AI 助手回复”AI:根据分析结果,宁波地铁3号线 K3+520 断面左线1号测点(PT-001)最近一周的沉降情况如下:
累计沉降:-12.3mm(当前值) 变化速率:-0.8mm/天(当前),平均 -0.5mm/天 趋势判断:沉降趋势不稳定,速率有加快迹象
未来3天预测:
- 预测沉降值:-14.1mm
- 置信区间:-15.5mm ~ -12.7mm
预警评估:
- 当前预警级别:橙色预警
- 趋势预警级别:红色预警
- 建议:加密监测频率至2小时/次,启动现场巡查,关注周边施工活动
7. 相关文档
Section titled “7. 相关文档”- MCP Server 概述 — 功能介绍和适用场景
- MCP Server 安装配置 — 详细的安装步骤
- MCP Server 资源访问 — 可访问的资源类型和路径格式
- MCP Server 集成示例 — 与主流 AI 平台的集成教程
- MCP Server 安全与认证 — 认证方式和权限控制
本文档由 RailWise 技术文档团队维护,最后更新于 2025-01-15。
