Skip to main content
Glama

find_agent_session

Search past agent sessions reconstructed from recorded shell commands by prompt, directory, executor, or date to identify which session did the work, then replay its timeline.

Instructions

Search past agent sessions reconstructed from recorded shell commands, by prompt text, directory, executor or date. Use this to discover which session did the work you care about, then replay_agent_session for its timeline. Pick this over list_agent_sessions when the agent's transcript was never captured but its commands were; pick search_commands instead when you want individual commands regardless of session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
afterNoOnly sessions' commands at or after this time: today, yesterday, N minutes ago, N hours ago, N days ago, N weeks ago, YYYY-MM-DD, or an ISO 8601 date-time such as 2026-10-18T10:00:00Z or 2026-10-18T10:00:00+05:30 (no offset means local time)
limitNoMax rows in this page (default: 10)
beforeNoOnly sessions' commands at or before this time; a bare date includes that whole day: today, yesterday, N minutes ago, N hours ago, N days ago, N weeks ago, YYYY-MM-DD, or an ISO 8601 date-time such as 2026-10-18T10:00:00Z or 2026-10-18T10:00:00+05:30 (no offset means local time)
detailNoAdd directory, duration, executor and session to each row (default: false)
offsetNoRows to skip; pass the response's next_offset to page forward
executorNoFilter by agent name (e.g. claude-code, cursor)
directoryNoFilter to sessions that ran commands in this directory or its subtree
prompt_textNoSearch across the first prompt of each session (substring match)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/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 it does disclose the key non-obvious trait: sessions are reconstructed from shell commands rather than agent transcripts, which is precisely why it can surface sessions other tools cannot. It does not state the return shape or pagination semantics, but the mutation/safety profile is unambiguous from 'Search'.

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?

Three sentences, front-loaded with the capability, then the forward-chaining step, then the two exclusion rules. No filler and no restatement of the title or schema.

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?

For an eight-parameter search tool with no output schema and no annotations, the routing and provenance information is unusually complete. The remaining gap is that it never sketches what a matching row contains (mitigated partly by the detail parameter's schema text and the pointer to replay_agent_session).

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 schema already documents time formats, paging, and the detail flag. The description only echoes the filter axes (prompt text, directory, executor, date), adding no syntax or semantics beyond the schema. Baseline 3 is correct.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (Search) and resource (past agent sessions), plus the reconstruction basis (recorded shell commands) and the four filter axes. It differentiates itself from list_agent_sessions and search_commands by name, so an agent can pick it without opening any schema.

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

Usage Guidelines5/5

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

Explicit routing: names the follow-up tool (replay_agent_session for the timeline), states the condition that selects this over list_agent_sessions (transcript never captured, commands were), and the condition that selects search_commands instead (individual commands regardless of session). This is textbook when/when-not/alternatives.

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