Skip to main content
Glama
codex-mcp-tool

codex-mcp-tool

list-sessions

Destructive

Lists active conversation sessions with metadata and supports deleting a single session or clearing all sessions.

Instructions

List all active conversation sessions with metadata, or manage sessions

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

Input Schema

NameRequiredDescriptionDefault
actionNoAction: list (default), delete (single session), clear (all sessions)list
sessionIdNoSession ID for delete action
workingDirNoWith delete: remove only the session for this directory. Without it, every session with that ID is removed (one sessionId can exist once per directory).

Output Schema

NameRequiredDescriptionDefault
errorNo
statsNo
actionYes
deletedNo
successNo
sessionsNo
sessionIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.7.0

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the safety profile is covered. The description adds that sessions carry metadata and that management actions exist, but it does not warn that "clear" wipes all sessions or that delete can span directories — that nuance lives only in the schema.

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?

A single front-loaded sentence with the primary purpose first. The trailing "or manage sessions" is low-value filler that could be replaced with a concrete pointer to the destructive actions.

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

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema and annotations exist, so return values and safety are covered elsewhere. However, for a tool with destructive delete/clear modes, the description should flag the irreversible bulk-clear behavior rather than leaving it entirely to the schema.

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 (action, sessionId, workingDir) are already documented, including the cross-directory delete behavior. The description adds no parameter meaning beyond the schema, so 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 ("List all active conversation sessions with metadata") and hints at the management modes. The trailing "or manage sessions" is vague, but the core listing purpose is unambiguous and distinguishable from siblings like list-skills.

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

Usage Guidelines2/5

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

No guidance on when to choose list vs delete vs clear, or when to prefer this over any alternative. The action semantics are only conveyed by the schema enum, not the description, so the agent gets no usage context from the prose.

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