Skip to main content
Glama

End Session

end_session

Ends a session and promotes top episodic memories to long-term storage so valuable conversation learnings are preserved.

Instructions

End a session and consolidate episodic memories.

Mirrors human memory consolidation: short-term (episodic) memories that prove valuable get promoted to long-term (semantic) storage.

Top episodic memories are selected by salience score (combining importance, trust, access count, and recency). Only memories above the threshold are promoted.

Use this at the end of a conversation to preserve valuable learnings.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "session_id": "<session_id>"
    },
    "name": "end_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
session_idYesSession ID to end
promote_topNoPromote top episodic memories to long-term storage (default: true)
promote_typeNoMemory type for promoted memories: 'project' or 'pattern' (default: project)

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.8.0

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose the selection mechanism (salience = importance, trust, access count, recency) and that only above-threshold memories are promoted, which is genuinely useful. However, it does not say whether ending a session is irreversible, what happens to non-promoted memories (discarded or retained), or whether existing session data is removed, leaving the mutation profile partly opaque.

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?

Purpose is front-loaded in the first line, with mechanism and usage following in short paragraphs. Readable and mostly economical, though the human-memory analogy sentence adds flavor more than operational information.

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?

Output schema exists, params are fully described in schema, and the description supplies the conceptual model and trigger condition an agent needs. Nothing essential for calling it correctly appears to be missing.

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 coverage is 100%, so session_id, promote_top and promote_type are already documented in the schema. The description adds background on how the 'top' memories in promote_top are chosen, but nothing param-specific beyond that. Baseline 3 applies when the schema does the heavy lifting.

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 plus the secondary effect: 'End a session and consolidate episodic memories.' The consolidation sentence makes clear this is not a plain session-terminate call and differentiates it from siblings like promote/demote that operate on individual memories.

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?

'Use this at the end of a conversation to preserve valuable learnings' gives a concrete trigger condition. It does not say when not to call it, nor does it explicitly route to sibling tools such as promote/demote for selective promotion, so it stops short of full alternative guidance.

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