Skip to main content
Glama

Rex CLI

rex

Runs CLI operations against the local terminal server to list sessions, capture screens, send input, 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, block stream, api call, attach, and create, layout, rename, close or kill commands; also -S server routing, because this bridge drives the local Rex server only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNo
commandNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so: it discloses the absence of a default session/block, the 90000 ms wait cap, that --wait propagates the command's exit status, and that 'send confirms typing, not that a command finished.' It also enumerates disabled subcommands and the disabled -S server routing, which prevents predictable failure modes.

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-loads purpose and the scoping constraint, and groups remaining content under Discovery/Act headings. It is dense with semicolon-chained clauses and long enough to risk skimming, but nearly every sentence carries operational information an agent needs.

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?

This is a high-complexity tool with no annotations and no output schema, yet the description covers invocation, target scoping, the run→capture composition, timeout handling, pushback on send semantics, and unsupported operations. Nothing material for correct invocation 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 description coverage is 0%, so the description must compensate, and it does: it states the mutual-exclusivity rule ('exactly one of args (array of strings) or command (quote-only string)') and explains the semantics of the embedded flags an agent will put inside args (-b, -w, -s, --wait, --keep-open). This is substantially more than the bare schema types convey.

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?

States a specific verb and resource ('Run the rex CLI against the local Rex server') and immediately frames the execution context (outside any Rex terminal). It also distinguishes itself from the only sibling by noting rex_skill holds the full guide, so an agent can route 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?

Provides an explicit discovery-then-act workflow (list → block ls / session inspect → capture/send/run/wait) plus a named composition pattern: run with --wait --keep-open, then capture -b BLOCK. It also gives a branch for wait_timeout, clarifying a decision an agent would otherwise have to guess at.

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