Skip to main content
Glama

search_codex_sessions

Search Codex CLI session transcripts and prompt history to find past messages and outputs. Use it to locate earlier commands, decisions, or context by keyword.

Instructions

Search across Codex CLI session transcripts or prompt history (~/.codex/history.jsonl).

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": {
      "query": "<query>"
    },
    "name": "search_codex_sessions"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax hits to return (default 15).
queryYesCase-insensitive search text.
scopeNoWhere to search (default 'transcripts').transcripts

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden. It discloses the underlying data location (~/.codex/history.jsonl) and that matching is case-insensitive via the schema, but it never states that the operation is read-only, whether it searches full message bodies or only prompts, or what a returned hit looks like.

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 sentence with zero filler, front-loading the verb, the resource, and the two searchable scopes in one clause. Nothing could be removed without losing information.

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?

For a simple three-parameter search with a fully documented schema and no output schema, the description is barely sufficient. It leaves the agent guessing about result shape and about differentiation from list/read siblings, which matters given seven sibling search/list/read tools in the catalog.

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 are already documented, and the enum for scope is self-explanatory. The description adds only the file path associated with the 'history' scope; it does not explain result ordering, how limit interacts with total matches, or what transcript-level granularity means.

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 ('Search') and resource ('Codex CLI session transcripts or prompt history'), and even names the backing store (~/.codex/history.jsonl) for one scope. It is clearly distinguishable from list_codex_sessions, but it never explicitly contrasts with read_codex_session, which is the natural companion when a session is already known.

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: 'search' suggests you use it when you don't know which session holds the content, leaving list_codex_sessions and read_codex_session as the alternatives for enumeration and retrieval. There is no explicit when-to-use or when-not-to-use statement, and no mention of prerequisites or exclusions.

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