Skip to main content
Glama
antigravity-codex-mcp
by Sunlazys

codex_list_sessions

Lists and merges Codex sessions from local $CODEX_HOME rollout files and MCP job records, letting you filter by source, cwd, query, and limit.

Instructions

List Codex sessions by merging local $CODEX_HOME/sessions rollout files and MCP job records. Sessions in both appear as source='both' and match both local and mcp filters.

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

Input Schema

NameRequiredDescriptionDefault
cwdNoFilter by exact working directory (path-normalized).
limitNoMax sessions to return (default 20).
queryNoCase-insensitive substring search across id, title, and cwd.
sourceNoFilter by source (default 'all'; 'both' matches both 'local' and 'mcp').

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations exist, so the description carries the full disclosure burden. It usefully reveals the underlying data model — two merged sources with an overlap case surfacing as source='both' that satisfies both filters — which an agent could not infer from the schema. It stops short of disclosing ordering, what a session record contains, or whether results are truncated beyond the limit.

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?

Two sentences, both load-bearing: the first establishes what is listed and from which two stores, the second covers the overlap case. The defining behavior is front-loaded with no filler.

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 simple read-only list tool with four optional, fully documented parameters and no output schema, the description covers the one genuinely surprising aspect (the merged local/MCP model). It omits result ordering and any link between returned session ids and follow-up tools like codex_get_session or codex_resume, which is a modest remaining gap.

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 four parameters are already documented, including the 'both' matching semantics for the source enum and the default limit of 20. The description restates the source overlap behavior rather than adding new parameter detail, so the baseline of 3 applies.

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 gives a specific verb and resource ('List Codex sessions') plus the non-obvious scope: it merges local $CODEX_HOME/sessions rollout files with MCP job records. That distinguishes it from a plain job lister, though it never names a sibling tool (e.g. codex_list_jobs) to sharpen the boundary.

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 only implied by the resource name and the note about how dual-source sessions match filters. There is no explicit 'use this when...' or 'do not use this when...' guidance, and no pointer to codex_get_session for fetching a single session or to codex_list_jobs for job-only listing.

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