Skip to main content
Glama
AgentHistoryMCP
by luo0629

Read Session Dialog (Live)

read_session
Read-onlyIdempotent

Read paginated user and assistant dialog turns from a saved agent session file to recover prior context, with optional branch selection and compact tool-call details.

Instructions

Read paginated user/assistant dialog turns live from the original session file (supports tree branches for Pi/Claude; verbose tool outputs are omitted).

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_id": "<session_id>"
    },
    "name": "read_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
agentNoSource agent_id (e.g. 'codex', 'claude'). Optional if session_id already includes '{agent}:' prefix.
limitNoNumber of messages to return (default 50).
offsetNoMessage offset for pagination (default 0).
branch_idNoOptional branch leaf ID for tree-structured sessions (Pi / Claude Code).
session_idYesComposite session_id ('codex:...') or native_session_id returned by list_sessions / search_history.
include_tool_callsNoInclude compact tool invocation names/arguments (default false — pure dialog only).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered. The description adds genuine context beyond that: it reads live from the original session file (fresh, not cached), supports tree branches for Pi/Claude, and deliberately omits verbose tool outputs, which explains the shape of what comes back.

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 no filler, stating source, pagination, branch support, and filtering in one pass. The two parentheticals are slightly dense but each carries distinct information, so nothing is wasted.

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

Completeness5/5

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

With 6 fully documented parameters, no output schema, and annotations covering safety, the description fills the remaining gaps an agent needs: data freshness ('live'), pagination, tree-branch handling, and the deliberate exclusion of verbose tool output. Nothing essential to calling it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds meaning beyond the schema by tying 'tree branches' to branch traversal and 'verbose tool outputs are omitted' to what dialog vs. tool-call content contains. That gives the agent interpretive context for branch_id and include_tool_calls rather than just restating field docs.

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: 'Read paginated user/assistant dialog turns live from the original session file', and clarifies scope with tree-branch support and omission of verbose tool outputs. It does not explicitly name sibling tools like list_sessions or search_history, so the differentiation is inferable (dialog content vs. metadata/search) rather than stated.

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 implied — read turns from a known session — but there is no explicit guidance on when to choose this over search_history or list_sessions, nor on prerequisites such as needing a valid session_id first. The agent must infer the routing from the resource wording alone.

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