Skip to main content
Glama
AnuwatThisuka

CMMS MCP Server

get_sensor_readings

Retrieve IoT sensor data for manufacturing operations, with filtering options by sensor, status, or time range to monitor equipment conditions.

Instructions

Get sensor readings from IoT system. Can filter by sensor, status, or time range.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sensorIdNoFilter by sensor ID
statusNoFilter by reading status
hoursNoGet readings from last N hours

Implementation Reference

  • The handler function `handleGetSensorReadings` filters and returns sensor readings based on `sensorId`, `status`, and `hours`.
    private handleGetSensorReadings(args: {
      sensorId?: string;
      status?: string;
      hours?: number;
    }) {
      let readings = [...mockSensorReadings];
    
      if (args.sensorId) {
        readings = readings.filter((r) => r.sensorId === args.sensorId);
      }
      if (args.status) {
        readings = readings.filter((r) => r.status === args.status);
      }
      if (args.hours) {
        const cutoff = new Date(Date.now() - args.hours * 3600000);
        readings = readings.filter((r) => new Date(r.timestamp) >= cutoff);
      }
    
      // Sort by timestamp descending
      readings.sort(
        (a, b) =>
          new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()
      );
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(readings, null, 2),
          },
        ],
      };
    }
  • Schema definition for `get_sensor_readings` tool.
    {
      name: "get_sensor_readings",
      description:
        "Get sensor readings from IoT system. Can filter by sensor, status, or time range.",
      inputSchema: {
        type: "object",
        properties: {
          sensorId: {
            type: "string",
            description: "Filter by sensor ID",
          },
          status: {
            type: "string",
            enum: ["normal", "warning", "critical"],
            description: "Filter by reading status",
          },
          hours: {
            type: "number",
            description: "Get readings from last N hours",
          },
        },
      },
    },
  • src/index.ts:400-401 (registration)
    Registration of the `get_sensor_readings` tool in the request handler switch statement.
    case "get_sensor_readings":
      return this.handleGetSensorReadings(args as any);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal insight. It does not indicate whether queries are expensive, if results are real-time or cached, pagination behavior, or what happens when no readings match the filters. 'Get' implies read-only, but safety/performance characteristics are missing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description consists of two efficient sentences with the primary purpose front-loaded. While the second sentence merely lists filtering capabilities already evident in the schema, there is no redundant or wasteful language.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple flat schema with three optional parameters and no output schema, the description provides minimally viable context. However, lacking annotations and output specification, it omits important behavioral context that would help an agent predict result sets and handle empty responses or large data volumes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Since the input schema has 100% description coverage, the baseline score is 3. The description essentially summarizes the three filter parameters (sensor, status, time range) without adding significant semantic context—such as explaining that 'hours' refers to a trailing window from current time, or that 'status' represents computed severity levels.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the action ('Get') and resource ('sensor readings') and specifies the system context ('IoT system'). It implicitly distinguishes from sibling 'get_sensors' by specifying 'readings' versus sensor metadata, though it could more explicitly clarify the temporal/data nature of the readings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions available filters but provides no guidance on when to select this tool over siblings like 'get_alerts' (which may also return critical sensor states) or 'get_sensors' (which may include current values). No prerequisites, exclusions, or decision criteria are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/AnuwatThisuka/cmms-mcp-server'

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