Skip to main content
Glama

session_context

Manage AI session context by scoring token budgets, compacting transcripts, pruning superseded reads, tracking mistakes and metrics, and storing or recalling project decisions and notes.

Instructions

Context hygiene: 'budget' (score S-F), 'compact' (fold transcript), 'prune' (drop superseded reads), 'mistakes', 'metrics', 'remember' (store a decision/note/preference), 'recall' (read project memory), 'forget' (remove one entry by id), 'recall_transcript' (BM25 search over prior session transcripts).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "session_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoforget: entry id; recall_transcript: <session>:<index> drill-down
kindNoremember: what kind of memory to store
textNoremember: the memory text (preferences as key=value)
filesNoremember: files this decision touches
limitNo
modelNo
queryNorecall: optional filter; recall_transcript: search terms
scopeNorecall_transcript: transcript scope (default project)
sinceNorecall_transcript: ISO lower bound
untilNorecall_transcript: ISO upper bound
actionNo
workspace_dirNo
transcript_pathNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changedv4.16.0
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "budget",
      -  "compact",
      -  "prune",
      -  "mistakes",
      -  "metrics"
      -]New value: +[
      +  "budget",
      +  "compact",
      +  "prune",
      +  "mistakes",
      +  "metrics",
      +  "remember",
      +  "recall",
      +  "forget",
      +  "recall_transcript"
      +]
    • addedInput schema / properties / files
      Added value: +{
      +  "description": "remember: files this decision touches",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / id
      Added value: +{
      +  "description": "forget: entry id; recall_transcript: <session>:<index> drill-down",
      +  "type": "string"
      +}
    • addedInput schema / properties / kind
      Added value: +{
      +  "description": "remember: what kind of memory to store",
      +  "enum": [
      +    "decision",
      +    "note",
      +    "preference"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "type": "integer"
      +}
    • addedInput schema / properties / query
      Added value: +{
      +  "description": "recall: optional filter; recall_transcript: search terms",
      +  "type": "string"
      +}
    • addedInput schema / properties / scope
      Added value: +{
      +  "description": "recall_transcript: transcript scope (default project)",
      +  "enum": [
      +    "this",
      +    "project",
      +    "all"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / since
      Added value: +{
      +  "description": "recall_transcript: ISO lower bound",
      +  "type": "string"
      +}
    • addedInput schema / properties / text
      Added value: +{
      +  "description": "remember: the memory text (preferences as key=value)",
      +  "type": "string"
      +}
    • addedInput schema / properties / until
      Added value: +{
      +  "description": "recall_transcript: ISO upper bound",
      +  "type": "string"
      +}
    • addedInput schema / properties / workspace_dir
      Added value: +{
      +  "type": "string"
      +}
  2. Changed7 schema fields changedv4.7.15
    • removedInput schema / properties / action / default
      Removed value: -"budget"
    • removedInput schema / properties / clear
      Removed value: -{
      -  "type": "boolean"
      -}
    • removedInput schema / properties / invocation_num
      Removed value: -{
      -  "type": "integer"
      -}
    • removedInput schema / properties / project_root
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / session_id
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / window_tokens
      Removed value: -{
      -  "type": "integer"
      -}
    • removedInput schema / required
      Removed value: -[
      -  "action"
      -]
  3. Addedv4.6.2

TDQS

C2.8/5.0
Behavior3/5

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

readOnlyHint=false correctly signals mutation, and the description does disclose what is altered for several actions ('fold transcript', 'drop superseded reads', 'remove one entry by id'), which the annotations do not convey. It stops short of saying whether these changes are reversible or persist across sessions, and 'budget', 'mistakes', and 'metrics' have no stated behavior at all.

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 scope label 'Context hygiene:' is front-loaded and the whole definition is a single dense sentence with no filler. The compression is slightly over-aggressive, since bare tokens like 'mistakes' and 'metrics' consume space without conveying meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 13-parameter, nine-action dispatcher with no output schema and only a single annotation, the description leaves too much unsaid: no return semantics for any action, no explanation of three actions, and no account of how optional params like 'limit' or 'model' interact with the action chosen. Action-to-parameter mapping is pushed entirely onto the schema.

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 62%, and the per-parameter schema descriptions already map most key params (id, kind, text, files, query, scope, since, until) to their owning actions. The description itself adds no parameter meaning beyond that, and 'limit', 'model', 'workspace_dir', and 'transcript_path' are undocumented in both places, so it neither compensates for the gap nor wastes space.

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

Purpose3/5

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

The framing 'Context hygiene' plus a list of nine actions tells an agent this is a multi-action dispatcher for managing session/context state, and glosses like 'compact (fold transcript)' and 'prune (drop superseded reads)' are concrete. However, three actions - 'budget (score S-F)', 'mistakes', and 'metrics' - get no explanation at all, so roughly a third of the tool's surface is opaque from the description alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to pick one action over another; the agent is left to infer the difference between 'budget', 'compact', and 'prune', all of which operate on context size. No siblings are referenced and no preconditions or exclusions are given, so routing among the nine actions is guesswork.

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