Skip to main content
Glama

rex_session_create

Create a persistent Rex session owned by rex-mcp and return its session ID and first block ID. Use it when programs must keep running beyond a one-off command.

Instructions

Create a session (rex new). rex-mcp owns it, so it may write to it. Returns its ID and first block ID. The session stays up for as long as its programs do; it is not closed for being idle. Prefer rex_run with wait_seconds for a one-off command, which closes that block when the command exits. A program in this session can close its own block when it finishes by running rex-mcp close.

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_session_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNo
labelNo
windowNoLabel for the first window
commandNoProgram and arguments, one word per element

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/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 full burden, and it does a lot: it discloses ownership ('rex-mcp owns it, so it may write to it'), returns ('its ID and first block ID'), the non-obvious lifecycle that idle sessions are not reaped, and that a program may self-close via `rex-mcp close`. Gaps remain on error behavior and resource/concurrency limits, which is why it is not 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and return values are front-loaded, followed by lifecycle, then the alternative — a sensible order with almost no filler. The `rex-mcp close` sentence is slightly tangential but does support the lifetime explanation, so it earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no annotations and no output schema, the description usefully covers return values and session lifetime, which is the hard part. However, it never addresses the optional parameter defaults (where the session starts, what label does), which is a real gap for a 4-parameter creation tool at 50% schema coverage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 50% — 'window' and 'command' are described in the schema, but 'cwd' and 'label' have no schema descriptions, and the tool description mentions none of the four parameters. For a creation tool, not saying what cwd defaults to or what label is used for leaves the agent guessing on the two undocumented parameters.

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+resource ('Create a session') and even gives the CLI equivalent ('rex new'), then distinguishes it from the sibling rex_run by name. An agent can tell exactly what this creates versus what rex_run does 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?

Explicitly says to prefer rex_run with wait_seconds for a one-off command, and gives the reason (rex_run closes the block when the command exits), so the when-to-use/when-not distinction is concrete rather than implied. The lifetime rule ('stays up for as long as its programs do; not closed for being idle') further tells the agent what kind of workload this tool is for.

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