Skip to main content
Glama

Set sensor

set_sensor
Idempotent

Set emulated Android sensor values to test accelerometer, gyroscope, orientation, light, or proximity logic. Provide x, y, z for multi-axis sensors or x only for single-value sensors.

Instructions

Set an emulated hardware sensor value (adb emu sensor set) — drive accelerometer/gyroscope/orientation (pass x, y, z) or a single-value sensor like light/proximity/temperature/pressure/humidity (pass x only). Use to exercise shake/tilt/rotation handlers or ambient-light/proximity logic. Emulator-only.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sensor": "<sensor>",
      "x": "<x>"
    },
    "name": "set_sensor"
  }
}

Input Schema

NameRequiredDescriptionDefault
xYesFirst value (the only value for single-axis sensors like light/proximity).
yNoSecond value for multi-axis sensors. Omit for single-value sensors.
zNoThird value for multi-axis sensors. Omit for single-value sensors.
sensorYesSensor name, e.g. acceleration, gyroscope, magnetic-field, orientation (3 values) or light, proximity, temperature, pressure, humidity (1 value).
serialNoTarget device serial (adb -s). Optional when exactly one device is attached.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

The annotations already declare idempotentHint=true, destructiveHint=false, and openWorldHint=false. The description adds meaningful context beyond that: it emulates a hardware sensor via adb emu, is emulator-only, and affects sensor-driven app logic, though it does not detail value ranges or persistence beyond the idempotency hint.

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

Conciseness5/5

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

The description is compact and front-loaded: the core operation and command are stated first, followed by axis guidance, use cases, and the emulator-only constraint. Every sentence contributes relevant selection or invocation information.

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

Completeness4/5

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

For a simple, annotation-rich, no-output-schema tool, the definition is nearly complete: it covers the operation, sensor categories, axis requirements, use cases, and emulator-only scope. It could add value ranges or units for sensor values, but that is a minor gap rather than a blocker.

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?

Schema description coverage is 100%, so the baseline is 3. The description restates the axis mapping for three-value versus one-value sensors, but that information is already present in the schema property descriptions, so it adds little beyond the structured fields.

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

Purpose5/5

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

The description gives a specific verb and resource: 'Set an emulated hardware sensor value', and names the underlying adb emu command. It also distinguishes multi-axis sensors requiring x, y, z from single-value sensors requiring only x, so an agent can identify exactly what this tool does.

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

Usage Guidelines4/5

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

It explains when to use the tool ('exercise shake/tilt/rotation handlers or ambient-light/proximity logic') and when it is not applicable ('Emulator-only'). It does not explicitly name alternatives among the set_* siblings, which keeps it short of full when-to-use/when-not guidance.

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