Skip to main content
Glama

read_codex_session

Read Codex CLI session transcripts by ID, prefix, title, or cwd substring while stripping environment_context and encrypted reasoning payloads for clean review and handoff.

Instructions

Read a Codex CLI session transcript cleanly (stripping environment_context and encrypted reasoning payloads). Supports lookup by session_id (or prefix) or title/cwd substring.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "session": "<session>"
    },
    "name": "read_codex_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNohandoff, recent, full, or files.handoff
sessionYesCodex session ID (or prefix) or title/cwd substring.
max_charsNoMaximum output size in characters (default 28000).
last_n_turnsNoNumber of latest turns to include (default 8).
include_tool_detailsNoInclude truncated tool arguments (default false).

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?

With no annotations the description carries the full burden, and it does disclose one real behavioral trait: payload sanitization. However, it omits read-vs-mutate framing, lookup-failure and ambiguous-match behavior, and the fact that output is size-bounded (max_chars) and turn-bounded (last_n_turns), which materially affects what the agent receives.

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 short sentences, both earning their place: the first gives purpose plus the sanitization trait, the second gives the lookup forms. The most decision-relevant information 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 5-parameter read tool with full schema coverage, no annotations, and no output schema, the definition covers purpose, lookup forms, and sanitization, which is nearly enough. The remaining gap is mode semantics and multi-match behavior, which the agent cannot infer from the schema alone.

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 every parameter including the mode enum is already documented. The description restates the session lookup forms (ID, prefix, title/cwd substring) without adding new meaning, and never mentions mode tradeoffs such as handoff vs full vs files. Baseline 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?

States a specific verb and resource ("Read a Codex CLI session transcript") and adds a distinguishing behavior: it strips environment_context and encrypted reasoning payloads. That tells an agent this is not a raw dump. It does not explicitly contrast with read_claude_session or search_codex_sessions, but the name and description make the resource clear.

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: read one session by ID/prefix or by title/cwd substring. There is no guidance on when to prefer this over search_codex_sessions or list_codex_sessions to first locate a session, and no note on what happens if the substring matches multiple sessions or none.

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