Skip to main content
Glama

LM Studio: compact a session

session_compact

Summarize a session to free its context, then continue with a fresh context seeded by that summary; use when context-full warnings appear.

Instructions

Free the context of a session: the model summarizes the conversation, and the next message starts a fresh context that begins with that summary. Use it when session_send or task_status warns that the context is getting full.

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": "session_compact"
  }
}

Input Schema

NameRequiredDescriptionDefault
session_idYesSession id from session_start or session_get.
instructionsNoWhat the summary must keep, in addition to the usual facts, decisions and open work.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=false, idempotentHint=false), the description discloses the key behavioral trait: it frees the conversation context and the next message begins with a generated summary. It does not elaborate on whether the summary is returned, whether the operation is reversible, or whether token costs apply, but the core mutation behavior is clearly explained.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tight sentences with no wasted words. The primary action is front-loaded, and the usage trigger follows immediately, making the definition easy to scan and act on.

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?

For a two-parameter session tool with full schema coverage and annotations, the description is nearly complete: it covers purpose, mechanism, and usage trigger. The main gap is that it does not say what session_compact returns directly, which matters slightly because there is no output 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 description coverage is 100%, so both session_id and instructions are already fully documented in the schema. The description does not add syntax or formatting details for either parameter; its note that the next message starts from the summary is contextual but does not explain parameter semantics beyond what the schema provides.

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 states a specific verb and resource — freeing a session's context — and explains the mechanism: the model summarizes the conversation and the next message starts a fresh context seeded with that summary. This is clearly distinguishable from siblings like session_send or session_get because it names the exact effect on the session.

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?

It gives an explicit trigger condition: use this when session_send or task_status warns that the context is getting full. That is a clear when-to-use signal tied to named siblings, though it does not state any when-not-to-use exclusions or explicit alternatives if the context is not full.

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