Skip to main content
Glama

Memory Session Ensure

memory_session_ensure

One-call session bootstrap: recover the active session or open one.

Replaces the memory_state_get → memory_session_close → memory_session_open → memory_state_set ritual. Reuses the session in the conversation/active-session state pointer when it is still open and owned by the caller; otherwise closes it (distilling) and opens a fresh one, updating state. Returns {session_id, agent, resumed, soul, soul_linked}. When the bearer is linked to a human account, soul is their private compressed identity block for this org (may be empty string if not yet written). When playbook_slug or a work_id with a bound slug resolves, also returns playbook {name, description, body_md, slug} (skill-expanded, capped) on both fresh and resume paths.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ttlNoSession TTL in seconds (default from server config)
repoYesWorkspace slug (absolute path with leading / removed and / replaced by -). Keys the conversation/active-session state pointer.
userNoSubstantive user request for this turn. When set, appended as the user turn in the same call (replaces a separate memory_session_append).
agentNoOverride agent identity
freshNoForce rotation: close any stored session (queueing distillation) and open a new one. Pass true on the first turn of a new chat.
topicNoWhat this session is about (used when opening a new one)
githubNoGitHub owner/repo; distilled memories inherit the tag
work_idNoWork item UUID. When set and playbook_slug is omitted, that item's playbook_slug is injected on the ensure payload.
playbook_slugNoNamed playbook to attach (wins over the work item's slug). Unset/missing/cross-org omits playbook — never dumps the catalog.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changed
    • addedInput schema / properties / playbook_slug
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Named playbook to attach (wins over the work item's slug). Unset/missing/cross-org omits playbook — never dumps the catalog."
      +}
    • addedInput schema / properties / work_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Work item UUID. When set and playbook_slug is omitted, that item's playbook_slug is injected on the ensure payload."
      +}
  2. First observed

TDQS

A4.5/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 disclosure burden and meets it: it details the state transition, side effects (closing with distillation, opening fresh, updating state), conditional return fields, and the appending of a user turn when 'user' is set. This goes well beyond a generic 'ensures a session' statement.

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?

The description opens with a crisp one-sentence summary and then uses dense, purposeful clauses for the lifecycle and return contract. It is long, but for a stateful bootstrap tool with conditional return behavior, each sentence earns its place; only minor trim could tighten phrasing.

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?

The description covers the session lifecycle, destructive/rotating behavior, distillation, return shape, and playbook resolution, which is enough for an agent to invoke it correctly. It does not define 'owned by the caller' or auth prerequisites, but the rich prose plus an output schema keep the remaining gaps minor.

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 the schema already documents all nine parameters and the baseline is 3. The description adds some contextual behavior around playbook_slug/work_id resolution and the fresh flag, but it does not substantially extend the schema's per-parameter explanations.

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 names a specific operation—'recover the active session or open one'—and positions it as a one-call bootstrap that replaces a four-step ritual. This clearly distinguishes it from siblings like memory_session_open, memory_session_close, memory_state_get, and memory_state_set.

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?

'Replaces the memory_state_get → memory_session_close → memory_session_open → memory_state_set ritual' is an explicit when-to-use statement, and the resume-vs-open logic tells the agent when the tool will reuse versus rotate. It also names conditions (owned and open; fresh flag) that route behavior, leaving little to inference.

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.

TDQS

B3.4/5.0
Disambiguation4/5

With 104 tools across many domains (memory, work, projects, files, agents, context, strategic, ontology), the use of clear prefixes (memory_, work_, project_, file_, agent_run_, context_) makes most tools distinct. However, there are some potential confusions between memory_session_* vs memory_state_*, and memory_recall vs memory_think vs memory_assemble_context, though descriptions clarify their specific purposes. Aliases like memory_playbook_get for memory_procedure_get are explicit and reduce ambiguity.

Naming Consistency5/5

Tool names follow a highly consistent pattern: prefix_domain_action (e.g., file_create, work_update, memory_recall, agent_run_start). All use snake_case, with verbs consistently placed after the domain prefix. Even less common tools like account_brief and attention_snapshot fit the overall naming scheme, making the set predictable and easy to navigate.

Tool Count3/5

At 104 tools, this is an exceptionally large surface area, far exceeding the 25+ threshold that feels heavy. However, the server covers an extensive domain (organizational memory, work management, project tracking, file sharing, agent orchestration, and strategic planning), which justifies a large count. Still, the sheer number may overwhelm agents, and some tools could be consolidated (e.g., many memory_session_* and memory_state_* variants).

Completeness4/5

The tool surface is remarkably complete for its stated purpose, covering CRUD operations for files, work items, projects, and memory, plus lifecycle management for agents, sessions, and strategic plans. Minor gaps exist (e.g., no direct memory_item_get by ID, no section removal in projects), but agents can work around these using existing tools like memory_recall or work_create with parent_id. Overall, the set minimizes dead ends.