Skip to main content
Glama

List prior Codex sessions

codex_sessions

List local Codex sessions with sessionId, working directory, and last activity. Filter by working directory to find sessions from a specific workspace.

Instructions

Discover Codex sessions stored locally under ~/.codex/sessions/. Returns sessionId, cwd, and last activity for each, newest first. sessionId can be passed to codex_continue to resume. Filter by cwd to find sessions from a specific workspace.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoFilter to sessions whose recorded cwd matches this path exactly.
limitNoCap on returned sessions (default 50, hard cap 500).
Behavior4/5

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

With no annotations, the description does well to clarify the tool's behavior: it is a read-only operation that returns session metadata. It specifies the return structure and sorting. It does not mention side effects or permissions, but for a list tool this is acceptable.

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?

The description is three concise sentences with no redundancy. It front-loads the key information ('Discover Codex sessions') and provides essential details efficiently.

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?

Given no output schema, the description adequately covers all essential aspects: what the tool does, its parameters, return values, and relation to sibling tools (codex_continue). For a simple list tool with two parameters, this is complete.

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?

Schema coverage is 100%, so baseline is 3. The description adds value by explaining the cwd filter's purpose ('to find sessions from a specific workspace') and implicitly references the limit parameter via the schema. This additional context raises the score above baseline.

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?

Description clearly states the tool's purpose: listing prior Codex sessions. It specifies the storage location, return fields (sessionId, cwd, last activity), and ordering (newest first). It also distinguishes itself by mentioning the connection to codex_continue for resuming sessions.

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

Usage Guidelines4/5

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

The description explains when to use the tool (to discover sessions) and provides a contextual use case: filtering by cwd to find sessions from a specific workspace. It also hints at the alternative of using codex_continue with the sessionId. However, it does not explicitly contrast with other siblings like codex_health or codex_review, so it loses a point for completeness.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/anhnguyen0905/codex-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server