Skip to main content
Glama

set_sensor

Set emulated sensor values on an Android emulator to test accelerometer, gyroscope, light, proximity, and other sensor-driven behaviors using adb.

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.

Input Schema

TableJSON 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.
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool is emulator-only and explains parameter usage for different sensor types. However, it does not mention error conditions, permission requirements, or what happens if the sensor name is invalid or the emulator is not running. Basic transparency is present but not exhaustive.

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?

Two sentences efficiently convey the core action, usage context, and parameter semantics. No extraneous information. Could be slightly improved by separating the parameter explanation into a clearer structure, but overall it is appropriately concise.

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?

For a tool with 5 parameters, no output schema, and no annotations, the description covers purpose, usage, and parameter semantics. However, it lacks mention of prerequisites (emulator must be running and booted, sensor must exist), how the serial parameter is used, and what the return value or error behavior is. Adequate but with noticeable gaps.

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

Parameters4/5

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

Schema description coverage is 100%, so baseline is 3. The description adds significant value by explaining the dual usage pattern: multi-axis sensors use x, y, z; single-value sensors use x only. It also provides concrete sensor examples (acceleration, gyroscope, light, proximity) that clarify the parameter schema beyond its individual descriptions.

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?

Description uses specific verb 'Set' and resource 'emulated hardware sensor value', references the underlying adb command, and distinguishes between multi-axis and single-value sensors. It clearly differentiates from sibling tools like set_battery or set_location which are not sensor-setting tools.

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?

Explicitly states when to use: 'exercise shake/tilt/rotation handlers or ambient-light/proximity logic'. Does not provide when-not-to-use or alternatives, but the sibling list lacks similar tools, so exclusion is not needed. Emulator-only constraint is clear.

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/iksnerd/adb-mcp'

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