Skip to main content
Glama

codex_sessions

Destructive

List or import Codex CLI sessions for a selected project or workdir; filter archived sessions and import stopped threads with retry or operation keys.

Instructions

Choose workdir or project_id. list takes cursor/limit/archived; import takes thread_id, confirm_stopped=true, optional archived and an operation key. Native scope is verified before work.

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": "codex_sessions"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
actionNolist
cursorNoNative cursor
workdirNoAbsolute project directory chosen by the main agent
archivedNo
thread_idNo
project_idNoSelected project; use instead of workdir
request_idNoKey for identical retries
operation_idNoAlias of request_id
confirm_stoppedNo

Output Schema

NameRequiredDescriptionDefault
okYes
result_versionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.3

TDQS

C2.9/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, openWorldHint=true and idempotentHint=false, so the safety bar is partly covered. The description adds genuinely non-structured details — a 'Native scope is verified before work' precondition and a confirm_stopped=true gate plus an operation key for retries — but it never says what import actually mutates or destroys, which is the key unknown for a destructive-hinted tool.

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?

Three tight sentences with no filler, and parameter routing is grouped per action, which scans well. It is compressed to the point of being telegraphic, though — the purpose is omitted while low-value phrasing like 'Native scope is verified before work' is kept.

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

Completeness2/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. But for a 10-parameter tool whose import branch is flagged destructive, omitting what a session is, what import does with thread_id, and what the list results represent leaves an agent unable to judge the consequences of calling it.

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?

With only 50% schema description coverage across 10 parameters, the description does real work: it establishes mutual exclusivity of workdir/project_id, scopes cursor/limit/archived to list, and makes confirm_stopped=true mandatory for import while flagging operation_id/request_id as the retry key. Only the exact semantics of archived under import and the meaning of 'native scope' remain underspecified.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description never states what the tool does — no verb+resource statement such as 'list or import Codex sessions'. It opens with a parameter choice ('Choose workdir or project_id') and only the 'list'/'import' enum values hint at the operation, leaving purpose to be inferred from the tool name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives usable invocation guidance: workdir XOR project_id, and which parameters belong to list versus import (including confirm_stopped=true for import). However, it offers no when-to-use guidance against obvious siblings like codex_list, codex_history, or codex_archive, and no conditions under which a caller should prefer import over another route.

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