query_sensors
Retrieve IoT sensor data by location and type for monitoring environmental conditions like temperature, humidity, or motion in robotics systems.
Instructions
Query IoT sensors by location
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| location | Yes | Location to query (e.g., "warehouse_1") | |
| sensor_type | No | Type of sensor (temperature, humidity, motion, etc.) |
Implementation Reference
- server.js:282-300 (handler)The querySensors method handles the logic for the query_sensors tool, making an axios call to the iot API.
async querySensors(args) { const response = await axios.post( `${API_BASE}/api-iot.php`, { action: 'query_sensors', location: args.location, sensor_type: args.sensor_type, }, { headers: { 'X-API-Key': API_KEY } } ); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; - server.js:97-114 (schema)The schema definition for the query_sensors tool, specifying required arguments and input types.
{ name: 'query_sensors', description: 'Query IoT sensors by location', inputSchema: { type: 'object', properties: { location: { type: 'string', description: 'Location to query (e.g., "warehouse_1")', }, sensor_type: { type: 'string', description: 'Type of sensor (temperature, humidity, motion, etc.)', }, }, required: ['location'], }, }, - server.js:191-192 (registration)The request handler case that routes the query_sensors request to the querySensors implementation.
case 'query_sensors': return await this.querySensors(args);