Skip to main content
Glama

read_gemini_session

Read Gemini CLI session transcripts in .json or .jsonl format by session ID, prefix, title, or working-directory substring, and extract recent, full, handoff, or file-focused context for agents.

Instructions

Read a Gemini CLI session transcript cleanly (supporting both .json and .jsonl formats). 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_gemini_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNohandoff, recent, full, or files.handoff
sessionYesGemini CLI 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

B3.1/5.0
Behavior2/5

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

With no annotations supplied, the description carries the full behavioral burden and falls short. It does not say what "cleanly" means, what happens when a title/cwd substring matches multiple sessions (ambiguity or error?), or whether output is truncated by max_chars — all material for a substring-lookup reader.

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?

Two tight sentences with the format-support parenthetical placed right after the core statement. Nothing is wasted, though the second sentence is largely redundant with the schema.

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

Completeness2/5

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

Five parameters with an enum of four modes (handoff/recent/full/files) whose semantics are never explained anywhere, and no output schema to compensate. The description never clarifies what a "handoff" or "recent" read returns, which is the central decision an agent must make before calling.

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 the baseline is 3. The description's lookup note ("session_id (or prefix) or title/cwd substring") merely restates what the schema already documents and adds no new meaning for mode, max_chars, last_n_turns, or include_tool_details.

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 Gemini CLI session transcript") and adds the file-format scope. It implicitly distinguishes itself from list_gemini_sessions/search_gemini_sessions by saying it reads a single transcript, but it never names those siblings or explicitly contrasts with them.

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: the agent can infer 'use this to read one session' versus listing or searching, but there is no explicit when-to-use, no when-not-to-use, and no named alternative to steer selection.

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