Skip to main content
Glama

session

Manage session lifecycle: start, end, check active, view history, clean stale sessions. Capture session summaries as atomic memories and get boot-time digests.

Instructions

Session lifecycle — start, end, history, active check, stale cleanup, and the v0.9.0 boot-time digest.

ACTIONS:

  • "start": Begin a new session. Returns session_id.

  • "end": End a TRACKED session (needs session_id). Returns stats. This closes session bookkeeping — it does NOT capture memories.

  • "capture": Segment a free-text session summary into atomic candidate memories (needs summary; NO session_id — it operates on the text, not on tracked-session state). Returns drafted rids. Use at end of substantial work so the session leaves a trace.

  • "history": View past sessions.

  • "active": Check if there's a running session.

  • "abandon_stale": Clean up orphaned sessions older than abandon_stale_hours.

  • "digest": One-call boot-time briefing (v0.9.0) — narrative chain head, open decisions/conflicts/triggers, top stale memories. Call this at conversation start instead of N separate recalls. Set include_gaps=True to fold known-unknowns (frequently-asked, poorly-answered queries) into the briefing — the active-learning loop. Set scope to filter content aggregates to one namespace for a per-tenant digest.

Args: action: "start", "end", "capture", "history", "active", "abandon_stale", "digest". session_id: For end. namespace: Memory namespace. client_id: Client identifier. metadata: For start — optional dict. summary: For end — optional closing note. For capture — REQUIRED, the session summary to segment into memories. domain: For capture — domain stamped on drafted memories. limit: For history. abandon_stale_hours: For abandon_stale — max age in hours. narrative_namespace: For digest — namespace for the narrative chain. scope: For digest — filter content aggregates to one namespace (per-tenant isolation); omit for a whole-DB digest. include_gaps: For digest — fold top knowledge gaps into the briefing. max_gaps: For digest — cap on gaps surfaced when include_gaps=True. max_decisions / max_conflicts / max_triggers: For digest — surface caps. snippet_chars: For digest — text-snippet length per item.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
scopeNo
actionYes
domainNogeneral
summaryNo
max_gapsNo
metadataNo
client_idNodefault
namespaceNodefault
session_idNo
include_gapsNo
max_triggersNo
max_conflictsNo
max_decisionsNo
snippet_charsNo
abandon_stale_hoursNo
narrative_namespaceNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

The description comprehensively discloses behaviors beyond annotations: e.g., end 'closes session bookkeeping — it does NOT capture memories', and capture 'operates on the text, not on tracked-session state'. Annotations already show readOnlyHint=false, consistent with mutations. No contradictions. Could mention rate limits or permissions but still strong.

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 is well-structured with a summary line, action bullet list, and parameter definitions. It is somewhat long but every sentence adds value. Minor redundancy: 'digest' action description includes parameter details repeated in the arg list, but acceptable.

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?

Given the tool's complexity (17 parameters, 7 actions) and the presence of an output schema, the description covers all actions and parameters thoroughly, including edge cases like abandon_stale and gaps in digest. No significant gaps for an agent to invoke 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?

With 0% schema description coverage, the description fully compensates by explaining each parameter's purpose per action, e.g., 'summary: For end — optional closing note. For capture — REQUIRED'. All 17 parameters are covered, providing critical context the schema lacks.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Session lifecycle' and lists seven actions (start, end, capture, history, active, abandon_stale, digest), clearly defining the tool's scope. It differentiates from sibling tools like remember/recall by focusing on session management rather than direct memory operations, though capture could overlap with remember; a clearer distinction would raise the score.

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?

The description provides explicit usage guidance for each action, e.g., 'Use at end of substantial work so the session leaves a trace' for capture, and 'Call this at conversation start instead of N separate recalls' for digest. It contrasts digest with separate recalls, but does not explicitly state when not to use session versus siblings.

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/yantrikos/yantrikdb-mcp'

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