Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
locationYesLocation to query (e.g., "warehouse_1")
sensor_typeNoType of sensor (temperature, humidity, motion, etc.)

Implementation Reference

  • 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),
          },
        ],
      };
  • 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);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RedCiprianPater/mcp-server-robotics'

If you have feedback or need assistance with the MCP directory API, please join our Discord server