get_sensors
Retrieve IoT sensor data from manufacturing systems. Filter sensors by type, status, or equipment to monitor operational conditions and maintenance needs.
Instructions
Get sensors from IoT system. Can filter by type, status, or equipment.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Filter by sensor type | |
| status | No | Filter by sensor status | |
| equipmentId | No | Filter by equipment ID |
Implementation Reference
- src/index.ts:754-778 (handler)The handleGetSensors method implements the logic for the get_sensors tool by filtering mockSensors based on optional arguments (type, status, equipmentId) and returning the result as a text content object.
private handleGetSensors(args: { type?: string; status?: string; equipmentId?: string; }) { let sensors = [...mockSensors]; if (args.equipmentId) { sensors = sensors.filter((s) => s.equipmentId === args.equipmentId); } if (args.type) { sensors = sensors.filter((s) => s.type === args.type); } if (args.status) { sensors = sensors.filter((s) => s.status === args.status); } return { content: [ { type: "text", text: JSON.stringify(sensors, null, 2), }, ], }; - src/index.ts:257-275 (registration)The get_sensors tool is registered in the IoT Tools section of the MCP server, including its schema definition and description.
{ name: "get_sensors", description: "Get sensors from IoT system. Can filter by type, status, or equipment.", inputSchema: { type: "object", properties: { type: { type: "string", enum: [ "temperature", "pressure", "vibration", "humidity", "flow", "level", ], description: "Filter by sensor type", },