Skip to main content
Glama

session_history

Retrieve every command from a shell session in chronological order, with paging. Optionally specify a session_id; if omitted, defaults to a recent session (may not be yours).

Instructions

Every recorded command of one shell session, oldest first. Pass a session_id you already have (from list_sessions, find_agent_session or resolve_current_agent_session); with none it falls back to whatever session is most recent, which may not be yours.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax rows in this page (default: 50)
detailNoAdd directory, duration, executor and session to each row (default: false)
offsetNoRows to skip; pass the response's next_offset to page forward
session_idNoSession ID (defaults to most recent — pass one explicitly to be sure)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does disclose the key trait: the no-session_id fallback behavior and the ordering of returned rows. It does not explicitly state the operation is read-only with no side effects, but for a history-reading tool that is strongly implied by the wording.

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 tight sentences, zero waste, with the resource and ordering front-loaded and the parameter-routing caution carried in a single parenthetical. Nothing to cut.

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?

No output schema or annotations, so the description must stand on its own; it covers scope, ordering, the session_id sourcing, and the risky default. The only residual gap is that row shape and pagination mechanics are not described, but for a command-list read tool an agent can reasonably infer the return form.

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 description coverage is 100%, so baseline is 3. The description adds real meaning beyond the schema for session_id: where to obtain it and what happens when it is omitted, which is the ambiguity the schema's own default note only hints at. Pagination semantics (offset/limit/detail) are left entirely to the schema.

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+resource ('Every recorded command of one shell session') plus result ordering ('oldest first'), which distinguishes it from cross-session siblings like recent_commands and search_commands. It is clear on scope, though it never explicitly names the siblings it is not, so a reader must infer the contrast from 'one shell session'.

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

Usage Guidelines4/5

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

Gives concrete routing guidance for the key parameter: pass a session_id 'you already have' and names three sibling tools (list_sessions, find_agent_session, resolve_current_agent_session) that produce one. It also warns that omitting it falls back to the most recent session 'which may not be yours'. It stops short of stating when to prefer this over recent_commands/search_commands.

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