Skip to main content
Glama

hid_descriptor

Decode HID report descriptors from capture paths or hex, optionally parse one report payload, to reveal report IDs/sizes before USB driver development.

Instructions

Decode a HID report descriptor (and optionally one report payload).

Read-only. When source is a capture path, finds GET_DESCRIPTOR type 0x22 transfers (replug the device while capturing if none are present). When source is hex, parses that descriptor directly (e.g. from /sys/class/hidraw/*/device/report_descriptor). Use this to understand report IDs/sizes before or alongside report/scaffold_driver; it does not infer vendor protocol fields from labelled actions.

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": {
      "source": "<source>"
    },
    "name": "hid_descriptor"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourceYesCapture path (searches for GET_DESCRIPTOR 0x22) or raw descriptor hex / hidraw report_descriptor bytes as hex
decode_hexNoOptional report payload hex to decode with the descriptor
report_typeNoReport type for decode_hex: Input, Output, or FeatureInput

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.2.1
    • addedInput schema / properties / decode_hex / description
      Added value: +"Optional report payload hex to decode with the descriptor"
    • addedInput schema / properties / report_type / description
      Added value: +"Report type for decode_hex: Input, Output, or Feature"
    • addedInput schema / properties / source / description
      Added value: +"Capture path (searches for GET_DESCRIPTOR 0x22) or raw descriptor hex / hidraw report_descriptor bytes as hex"
  2. First observedv0.2.0

TDQS

A4.6/5.0
Behavior4/5

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

No annotations are provided, so the description carries the burden, and it does declare 'Read-only' plus the concrete lookup behavior for capture sources (searches GET_DESCRIPTOR type 0x22) and the remediation hint about replugging. It stops short of describing failure/empty-result behavior or any limits, keeping it below a 5.

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?

Front-loaded purpose line, then a short read-only/behavior paragraph and a short usage paragraph. Every sentence adds information (source handling, sibling relationship, exclusion) with no filler.

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?

An output schema exists so return values need not be explained, and the description covers read-only status, both source modes, and sibling routing. The remaining gap is failure/edge behavior (e.g., what happens when no descriptor is found in a capture), which the replug hint only partially addresses.

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 coverage is 100%, so the baseline is 3, but the description adds real meaning beyond the schema: it distinguishes capture-path vs hex sources and gives a concrete hex source example (/sys/class/hidraw/*/device/report_descriptor). That example materially helps an agent choose the right input form.

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 opening sentence gives a specific verb (decode) and resource (HID report descriptor) plus an optional extension (one report payload). It further sharpens scope against siblings by stating it 'does not infer vendor protocol fields from labelled actions,' which distinguishes it from report/scaffold_driver.

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?

Explicit when-to-use ('to understand report IDs/sizes before or alongside report/scaffold_driver') and an explicit exclusion (it does not infer vendor protocol fields). It also gives the operational precondition for capture sources: replug the device while capturing if no GET_DESCRIPTOR 0x22 transfers exist.

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