Skip to main content
Glama

session_compact

Compress session context to free headroom and maintain output quality. Optionally focus on important topics to retain details. Run before context exceeds 70%.

Instructions

Compress the session's context via /compact to recover headroom.

Optionally pass focus to bias what is retained, e.g. "the auth refactor". Output quality degrades above ~70% context usage, so compact before then.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
focusNo
Behavior3/5

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

The description discloses the compaction mechanism, optional focus to bias retention, and a quality degradation threshold. However, it does not explicitly state that compaction is lossy or irreversible, nor what happens to existing messages. With no annotations, this leaves meaningful gaps.

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?

The description is brief and front-loaded with the core action. Each sentence adds value: the mechanism, the optional parameter, and the usage threshold. No wasted words.

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

Completeness3/5

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

Covers the primary purpose and includes a practical threshold, but omits the `name` parameter, return value (no output schema), and side effects of compaction. For a session-management tool with no annotations or schema descriptions, this is only partially complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description explains the `focus` parameter with an example but completely omits the required `name` parameter. Given 0% schema description coverage, this is a significant deficiency because the agent has no clue what `name` refers to.

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 clearly states a specific action (compress session context) via a specific mechanism (`/compact`) and purpose (recover headroom). This distinguishes it from sibling session-management tools that focus on lifecycle or messaging.

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?

Provides a concrete threshold for when to use (above ~70% context usage) and explains why (output quality degrades). It does not explicitly name alternatives, but the threshold gives clear usage context.

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/joschi655/claude-code-mcp'

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