Skip to main content
Glama
0Mattias
by 0Mattias

episode_write

Append a session journal to record transient iteration takeaways and run state that durable memory rejects. Episodes provide time-limited storage for cross-session context and handoff.

Instructions

Append a journal-shaped entry for the current session — for run-state, iteration takeaways, 'what we tried'. Episodes are NOT durable facts; the durability gate that rejects transient memory_write content (TRANSIENT_PHRASE_MARKERS) does not apply here. Stored at /episodes//.md with a default 30-day TTL.

Use this for content memory_write would reject as transient:

  • 'iteration N tried X, fell over at step 3'

  • 'currently blocked on Y; next step is Z'

  • 'this branch's release plan' (state that changes weekly)

Episodes are invisible to memory_search / memory_health / memory_list — they are a sibling tier, not a memory category. Surface them via episode_handoff at iteration entry or episode_search for cross-session lookup. Promote a takeaway to durable memory via episode_promote (routes through memory_write, durability gate fires as normal).

Returns {status: 'committed', id, session_id, created, scopes, takeaway, swarm_id, pruned_sessions}. pruned_sessions lists any prior session directories that hit the 30-day TTL on this write (typically []).

Parameters:

  • body: free-form markdown. Required, non-empty. Capped by max_content_bytes (default 1 MB).

  • swarm_id (optional): cohort id for multi-agent swarm fan-in. When a coordinator fans out parallel sub-agents, each sub-agent passes the coordinator's session id here so the coordinator can later gather every sub-agent's takeaways via episode_search(swarm_id=…). The episode still lives under this writer's own session; swarm_id is a cross-cutting label. Distinct from episode_handoff's single-chain predecessor link.

  • takeaway (optional): one-sentence summary. Surfaced preferentially at episode_handoff; when None, handoff falls back to the first line of body. Capped by max_takeaway_bytes (default 4 KB) — the takeaway lives in YAML frontmatter (64 KB ceiling), so an over-cap takeaway would corrupt the file and the episode would vanish from every read surface despite returning committed.

  • scopes (optional): list of scope tags. Empty list is valid (handoff keys on session_id, not scope). Capped by max_scopes_per_write (default 64) — scopes serialise into the YAML frontmatter (64 KB ceiling), so a runaway scope list would corrupt the file and the episode would vanish from every read surface despite returning committed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYes
scopesNo
swarm_idNo
takeawayNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

No annotations are provided, so the description carries the full burden. It discloses key behavioral traits: episodes are not durable facts, the durability gate does not apply, a 30-day TTL, storage path, invisibility to memory tools, pruning of prior sessions, and even the corruption risk from oversized takeaway/scopes which would make episodes vanish despite returning 'committed'.

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 every sentence earns its place. It is front-loaded with the core purpose, then structured into usage guidance, storage/lifetime, visibility, return value, and parameter details with bullet examples. No fluff or redundancy.

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 4 parameters, no annotations, and an output schema described in text, the description covers all necessary context: storage path, TTL, durability semantics, return fields (including pruned_sessions), and parameter constraints. It is fully self-sufficient for an agent to select and invoke the tool correctly.

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%, but the description richly explains each parameter: body (required, markdown, capped), swarm_id (multi-agent fan-in, distinction from predecessor link), takeaway (one-sentence summary, frontmatter cap, corruption risk), and scopes (empty valid, cap, serialization risk). This goes far beyond the bare 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?

The description opens with a specific verb+resource: 'Append a journal-shaped entry for the current session.' It clearly distinguishes from sibling memory/episode tools by stating that episodes are a sibling tier, not a memory category, and that they are invisible to memory_search/memory_health/memory_list.

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?

Explicitly states when to use this tool: 'Use this for content memory_write would reject as transient' with concrete bullet examples. Also names alternatives: 'Surface them via episode_handoff at iteration entry or episode_search for cross-session lookup' and 'Promote a takeaway to durable memory via episode_promote'.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/0Mattias/bettermemory'

If you have feedback or need assistance with the MCP directory API, please join our Discord server