Skip to main content
Glama

episode_handoff

Retrieve the latest journal takeaways from the previous worktree session to quickly understand what was concluded before continuing work. Use at loop entry to avoid manual memory search.

Instructions

Read the most-recent journal takeaways from a prior session in this worktree. Call this FIRST at a /loop iteration entry: it answers 'what did the last session conclude here?' without memory_search. Episodes are the sibling-to-memory primitive for journal-shaped writes (see episode_write).

When prior_session_id is omitted the handler auto-resolves it from the event log under two implicit filters: caller-worktree strict equality (None matches only None) and the disabled_scopes cascade (a session whose only takeaways are scope-disabled is skipped; surviving episodes are scope-filtered). Pass it explicitly to override.

Returns a dict:

  • prior_session_id: the resolved session id, or None when no prior session exists in the log.

  • episodes: list of {id, created, takeaway, scopes, provenance} dicts, oldest first, capped at max_episodes (default 5, cap 50). provenance is read from the event log: local (an episode_write event names the id), untracked (no event could have) or unaccounted (the file appeared with no event: the planted shape). body is present only with include_bodies=True (default False) and never for an unaccounted episode; episode_search(ids=[...]) is the explicit read for one body.

  • note (optional str): set ONLY when the immediately-prior worktree session left nothing visible; names the cause: floor-only, zero-episode, promoted-out, or all-scope-hidden. The last two DID journal, so a note never means 'wrote no journal'. episodes MAY be non-empty: the walk rewinds to an older takeaway.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_episodesNo
include_bodiesNo
prior_session_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv7.1.0
    • addedInput schema / properties / include_bodies
      Added value: +{
      +  "default": false,
      +  "type": "boolean"
      +}
  2. First observedv3.34.0

TDQS

A4.9/5.0
Behavior5/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 delivers richly: it discloses the auto-resolution algorithm for prior_session_id (caller-worktree strict equality and the disabled_scopes cascade), the provenance taxonomy (local/untracked/unaccounted), body-presence rules, and subtle note semantics ('The last two DID journal, so a note never means wrote no journal'). This goes well beyond what any annotation set would normally provide.

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?

The description is long but front-loaded: core purpose in sentence one, then usage guidance, then parameter semantics, then a clean bulleted return contract. Each sentence carries distinct information, and the density is justified by the tool's genuine complexity rather than padding.

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 a tool with this complexity — auto-resolution, two implicit filters, provenance values, note causes — the description is nearly exhaustive, and the raw return shape is already covered by the declared output schema. The residual gap is error semantics: what happens when an explicit prior_session_id does not exist in the log, and whether the call itself records any event, are unspecified.

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

Parameters5/5

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

Schema coverage is 0%, and the description fully compensates: max_episodes is explained as a result cap (default 5, cap 50), include_bodies gates the body field (and never for unaccounted episodes), and prior_session_id gets its auto-resolve/override semantics spelled out. Every parameter gains meaning far beyond its bare type and default in the schema.

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?

Opens with a specific verb+resource+scope: 'Read the most-recent journal takeaways from a prior session in this worktree.' It explicitly positions itself against memory_search ('without memory_search') and names episode_write as its sibling primitive, so an agent can distinguish it from the memory_* and episode_* siblings without opening their schemas.

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?

Gives explicit when-to-use: 'Call this FIRST at a /loop iteration entry: it answers what did the last session conclude here?' It names the alternative it avoids (memory_search) and routes body retrieval to episode_search(ids=[...]), providing both an exclusion and a fallback path. Nothing is left to inference.

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