Skip to main content
Glama

list_codex_sessions

Lists OpenAI Codex CLI sessions from ~/.codex/sessions with IDs, titles, working directories, models, git branches, and updated timestamps; filter by query or cwd.

Instructions

List OpenAI Codex CLI sessions from ~/.codex/sessions with session_id, title, working directory, model, git branch, and updated timestamp.

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

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum sessions to return (default 25).
queryNoOptional substring filter on title, cwd, model, or ID.
cwd_filterNoOptional substring filter on working directory.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It helpfully discloses the source path (~/.codex/sessions) and the returned field set, which implies a read-only local scan, but it never explicitly states read-only/no-side-effect behavior, result ordering, or what happens when no sessions exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

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

A single front-loaded sentence with no filler; the resource, source location, and returned fields all earn their place.

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?

For a three-parameter, zero-required list tool with full schema coverage, the description covers the resource, data source, and return fields well enough to call it correctly. The absence of an output schema is offset by the enumerated field list, though ordering and empty-result behavior remain unstated.

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

Parameters3/5

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

Schema description coverage is 100%, so all three parameters (limit, query, cwd_filter) are already documented in the schema. The description adds no extra meaning about parameter interplay, such as whether query and cwd_filter combine or how limit interacts with filtering.

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

Purpose4/5

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

The description pairs a specific verb ('List') with a precise resource ('OpenAI Codex CLI sessions') and names the storage location (~/.codex/sessions) plus the exact fields returned. It does not explicitly contrast itself with the sibling search_codex_sessions or read_codex_session, so the enumeration-vs-search distinction is only implied by the 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?

Usage is implied by the listing verb and the filter parameters, but the description never states when to use this over search_codex_sessions or read_codex_session, nor any when-not condition. The agent must infer the routing decision from the tool name alone.

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