Skip to main content
Glama

Close Session

engram_close_session
DestructiveIdempotent

Finish an exact journal at a real completion or handoff. Unlike engram_reflect, this atomically closes the session after saving a supplied final summary or confirming an existing checkpoint. Durable memories and journal history remain; closure ends journal writes without erasing knowledge. Returns JSON with session_id, closed_at, checkpoint_id, already_closed and memories_retained.

Get session_id from start/rehydrate/list_sessions. Only this session's member or a human workspace owner may close it; team read access does not grant close authority. A missing checkpoint or failed save leaves it active. Repeating close returns the original receipt without duplicate summaries. Closed journals are read-only for explicit rehydrate and cannot be implicitly reopened. Consumes daily call quota. OAuth: session:write.

Input Schema

NameRequiredDescriptionDefault
summaryNoFinal checkpoint text, at most 6000 characters and no credentials. Omit when reusing an existing checkpoint. Erased journals reject new text; omit to reuse their redacted checkpoint, or start a new session.
session_idYesExact journal id to close; required. Never pass a repo slug or a natural-language query.

Output Schema

NameRequiredDescriptionDefault
textYesThe same bounded payload as content[0].text; interpret it using format. JSON text contains the endpoint-specific fields described by this tool.
formatYesPayload encoding: Markdown context/checkpoint, serialized JSON data, or plain confirmation text.
truncatedYesTrue when the payload exceeded 120,000 characters and was cut with a notice. Narrow the request; truncated JSON is not parseable.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructive/idempotent, and the description adds real value on top: what survives closure ('durable memories and journal history remain'), the authorization model ('only this session's member or a human workspace owner may close it; team read access does not grant close authority'), quota consumption, OAuth scope, and idempotent-replay semantics.

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?

Front-loaded with the core action and its sibling contrast, then tight operational facts. It is dense and runs several long sentences, but each line carries non-redundant information; only the return-field enumeration is arguably duplicative of the output schema.

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?

The output schema exists so return values need not be restated, yet the description still covers auth scope, quota, idempotency, failure/re-entry behavior, and the fact that closure is not an erase. Nothing an agent needs to invoke this 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?

With 100% schema coverage the baseline is 3, but the description adds sourcing and negative-use guidance beyond the schema: where session_id comes from and 'never pass a repo slug', plus how to handle summary when a redacted checkpoint exists. These are practical constraints not present 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?

States a specific verb and resource ('atomically closes the session') plus its trigger condition ('at a real completion or handoff'). It explicitly differentiates from the sibling engram_reflect, so an agent can distinguish the two without opening either 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?

Names the alternative (engram_reflect) and the selecting condition (completion or handoff), tells the agent where to obtain session_id (start/rehydrate/list_sessions), and specifies when closure does not take effect ('a missing checkpoint or failed save leaves it active'). Guidance is explicit rather than inferred.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources