Skip to main content
Glama

Pre-register codex tmux pane

pre_register_codex_pane

Pre-register a pending tmux-pane claim with pane ID and UUID so a launcher can reserve the pane before starting Codex, letting later agent registration auto-bind the correct UI pid.

Instructions

Pre-register a pending tmux-pane claim so the launcher can claim a tmux pane before starting codex. The launcher should call this with $TMUX_PANE and a freshly generated UUID, then exec codex --remote ... -c xats.agent_id="\"<uuid>\"". When the codex agent later calls register_agent({agent_type:"codex"}) without ui_pid, the daemon uses the pending row to resolve the correct UI pid and auto-bind the pane. Callable without a prior register_agent — launchers have no agent identity yet. TTL defaults to 120 seconds and is capped at 600; pending rows are garbage-collected opportunistically.

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": {
      "pane_id": "<pane_id>",
      "xats_agent_id": "<xats_agent_id>"
    },
    "name": "pre_register_codex_pane"
  }
}

Input Schema

NameRequiredDescriptionDefault
pane_idYes
ttl_secondsNo
xats_agent_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does a lot: it discloses TTL default (120s), the cap (600s), opportunistic garbage collection of pending rows, and the daemon-side auto-bind behavior later. It does not cover failure modes such as duplicate `pane_id` submissions or whether re-calling overwrites an existing pending row, leaving idempotency/error behavior unclear.

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?

Five sentences, front-loaded with the core purpose before mechanics and lifecycle. The embedded command snippets are dense but earn their place; a slight trim of the quoted `exec` line would cost nothing.

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?

No annotations and no output schema, yet the description explains the full write-then-consume lifecycle so an agent can call it correctly. Missing are the return value and duplicate-row/error semantics, which matter for a registration-style primitive.

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 0%, so the description must compensate, and it does: `pane_id` is tied to `$TMUX_PANE`, `xats_agent_id` is specified as a freshly generated UUID that must match the `xats.agent_id` config, and `ttl_seconds` gets a default and a functional cap of 600 that is far stricter than the schema's numeric maximum. That exceeds anything the schema conveys.

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 description uses a specific verb ('pre-register') plus a precisely named resource ('a pending tmux-pane claim') and frames it as a preparatory step distinct from `register_agent`, which it names directly. An agent can tell this apart from `register_agent` and `detect_tmux_pane` without opening a 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?

It states exactly who calls it (the launcher), with what arguments (`$TMUX_PANE` and a fresh UUID), in what sequence (before `exec codex --remote`), and the downstream condition that makes it work (`register_agent` without `ui_pid`). It also explicitly resolves the key eligibility question: callable without a prior `register_agent` because launchers have no agent identity yet.

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