Skip to main content
Glama

Robot Actions — Remote Device Control

device_uhid_gamepad_state

Set gamepad state via UHID (id=3). On first call, CREATE is sent automatically. lx/ly/rx/ry are u16 LE stick axes (0-65535, center=32767); lt/rt are u16 LE triggers (0-32767, 0=released). dpad is a u8 hat (1=N,2=NE,3=E,4=SE,5=S,6=SW,7=W,8=NW,0=center). buttons is a u16 LE bitmask. The pad presents as a DualShock 4, so the bit order is that controller's, NOT the browser Gamepad API order: bit0=X/square, bit1=A/cross, bit2=B/circle, bit3=Y/triangle, bit4=L1, bit5=R1, bit6=L2, bit7=R2, bit8=share/select, bit9=options/start, bit10=L3, bit11=R3, bit12=PS/guide, bit13=touchpad. Note the face buttons are rotated: square is bit0 and cross is bit1. Bits 14-15 have no effect. device_gamepad_state is the higher-level twin — W3C standard button/axis arrays plus a selectable controller profile, with the bit packing done for you. Prefer it unless you specifically need to send this exact raw report.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ltNoLeft trigger (0-32767, default 0)
lxNoLeft stick X (default 32767 = center)
lyNoLeft stick Y (default 32767 = center)
rtNoRight trigger (0-32767, default 0)
rxNoRight stick X (default 32767 = center)
ryNoRight stick Y (default 32767 = center)
dpadNoD-pad hat value 0-8 (default 0 = center)
udidYesDevice serial number (UDID)
buttonsNoButton bitmask u16 (default 0)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.9/5.0
Behavior5/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 the automatic CREATE on first call, the raw bit layout, the DualShock 4 emulation, the face-button rotation, and that bits 14-15 are ignored. This is exceptionally transparent for a raw-report tool.

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 is dense and front-loaded with the core purpose and auto-CREATE behavior, then details format specifics and ends with sibling guidance. It is long but every sentence adds value for a complex raw HID report; slightly overlong but justified.

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

Completeness5/5

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

For a low-level UHID tool with no output schema and no annotations, the description covers everything an agent needs: the auto-CREATE, all parameter encodings, defaults, bit order, and the sibling alternative. Nothing essential is missing.

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

Parameters5/5

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

Even though schema coverage is 100%, the description adds crucial meaning: lx/ly/rx/ry are u16 LE with center 32767, lt/rt are u16 LE with 0=released, dpad hat mapping (1=N...0=center), and the exact button bitmask order. These details are absent from the schema, which only gives ranges and defaults.

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 states a specific action: 'Set gamepad state via UHID (id=3)' and notes automatic CREATE on first call. It clearly distinguishes from the sibling device_gamepad_state by describing it as the higher-level twin, so an agent can pick the right tool without opening schemas.

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

Usage Guidelines5/5

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

Explicitly names the alternative device_gamepad_state and gives a decision rule: prefer it unless you need to send this exact raw report. This is textbook usage guidance with a clear when-to-use and when-not-to-use.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources