Skip to main content
Glama

Rex CLI

rex

Runs allowlisted CLI commands against the local server to list sessions, capture terminal screens, send keystrokes, and execute commands with optional wait for exit status.

Instructions

Run the rex CLI against the local Rex server. This bridge runs outside any Rex terminal, so there is no default session or block: scope every call explicitly. Discovery: list (sessions), then block ls -s SESSION or session inspect -s SESSION. Act: capture -b BLOCK reads a terminal screen; send or send-key types into a terminal and needs an explicit target (-b BLOCK, -w WINDOW or -s SESSION); run -s SESSION -- CMD starts a command in a new block, with --wait to block until it exits (its exit status becomes the call's exit status) and --keep-open to keep the block for capture afterwards; wait TARGET blocks until a block, window or session ends, capped at 90000 ms; help shows syntax; rex_skill reads the full guide. To run a command and read its output: run -s SESSION --wait --keep-open -- CMD, then capture -b BLOCK. On wait_timeout, capture the target (a reply may already be on screen) and repeat wait with the same target if the exit status is still needed; otherwise carry on and check back later. send confirms typing, not that a command finished. Supply exactly one of args (array of strings) or command (quote-only string). Disabled here: do (Lua), events, kill, cp, forward, new, split, focus, zoom, move, swap, resize, actions, keymap, version, home, hosts, config, server, login-server, skill; inside the allowed verbs, block new/close/focus/zoom/move/swap/rename/stream/call and api call; and -S server routing, because this bridge drives the local Rex server only.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "rex"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNo
commandNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it discloses the missing default session/block, exit-status propagation from --wait, the 90000 ms cap on wait, the caveat that 'send confirms typing, not that a command finished,' and the full set of disabled verbs and flags. These are exactly the behavioral traits (mutation effects, blocking, constraints) an agent cannot infer from the schema.

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?

Front-loaded with purpose before the operational detail, and nearly every sentence carries usable instruction (discovery order, run recipe, timeout recovery, disabled verbs). It is a single dense block, however, so the long disabled-verb enumeration is hard to scan and could be delimited for faster parsing.

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 passthrough CLI bridge with zero annotation coverage, no output schema, and a loosely typed two-parameter schema, the description supplies the workflow, the key command recipes, failure handling, and hard boundaries. Nothing essential to invoking it correctly appears to be missing.

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 0%, so the description must compensate, and it does: 'Supply exactly one of args (array of strings) or command (quote-only string)' encodes a mutual-exclusion and quoting rule the schema does not express (only additionalProperties:false is declared). It stops short of explaining how the two forms map onto CLI tokens, leaving some inference required.

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: 'Run the rex CLI against the local Rex server,' and immediately clarifies scope ('runs outside any Rex terminal, so there is no default session or block'). It also distinguishes itself from the sibling by stating 'rex_skill reads the full guide,' so an agent can route between the two without opening either 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?

Gives an explicit discovery-then-act workflow (list -> block ls/session inspect -> capture/send/run/wait) and names the alternative for deeper docs (rex_skill). It states the exact invocation for the common task ('run -s SESSION --wait --keep-open -- CMD, then capture -b BLOCK') and prescribes recovery on wait_timeout, plus an explicit disabled-verb list that functions as a when-not-to-use boundary.

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

Deploy Server

Other Tools