Skip to main content
Glama

Robot Actions — Remote Device Control

Device UHID gamepad state

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

A5/5.0
Behavior5/5

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

Annotations only declare the safety profile (not read-only, not destructive, not idempotent). The description goes well beyond that by disclosing a hidden side effect (implicit CREATE on first call) and a genuinely surprising behavior (DualShock 4 emulation means face buttons are rotated relative to the Gamepad API, square=bit0, cross=bit1; bits 14-15 are inert). This is exactly the context annotations cannot carry.

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 long but every clause carries load-bearing information — axis ranges, trigger ranges, hat mapping, bit order, and the alternative — with the verb and operation id front-loaded. There is no filler sentence, and the caveat about button rotation is emphasized in its own sentence where it matters most.

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 9-parameter, no-output-schema tool that writes a raw HID report, the description covers the encoding scheme, lifecycle (implicit create), the emulated controller identity, and the routing decision versus the higher-level sibling. Nothing an agent needs to invoke this correctly 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?

Schema coverage is 100%, so the baseline would be 3, but the description supplies meaning the schema lacks entirely: the button bitmask is undocumented per-bit in the schema (only 'Button bitmask u16') and the description enumerates all 14 bits including the rotated face buttons. It also gives the dpad hat direction mapping (1=N ... 8=NW, 0=center) and confirms the u16 LE encoding for the axes.

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?

Opens with a specific verb+resource: 'Set gamepad state via UHID (id=3)', and immediately distinguishes itself from the sibling device_gamepad_state ('the higher-level twin ... Prefer it unless you specifically need to send this exact raw report'). An agent can tell this apart from device_uhid_input, device_uhid_create, and device_gamepad_state without opening any schema.

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 states the exact condition that selects this tool: needing to send the raw report yourself. It also pre-empts a prerequisite question by noting 'On first call, CREATE is sent automatically', so the agent knows no separate create step is required.

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