Skip to main content
Glama

cleanup_sessions

Remove stale terminal sessions and optionally close their tabs when sessions are inactive beyond a configurable time threshold. Run periodically to clear accumulated tabs.

Instructions

Remove stale terminal sessions that have been inactive. Use periodically to clean up accumulated tabs. Sessions inactive longer than inactive_minutes (default: 30) are removed. Set close_tabs to true to also close the terminal tabs.

Input Schema

NameRequiredDescriptionDefault
close_tabsNoIf true, also closes the terminal tabs for stale sessions (default: true)
inactive_minutesNoMinutes of inactivity before a session is considered stale (default: 30)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.2.5

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses that sessions are removed and that close_tabs also closes terminal tabs, but it does not state whether removal is irreversible, whether active sessions are protected, or what permissions are required.

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 front-loaded with the purpose, followed by usage and parameter behavior. It is efficient and readable, though it repeats default values already present in the schema.

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?

There is no output schema or annotation coverage, but the description supplies the essential operational context: stale threshold, optional tab closing, and periodic cleanup. It could mention what is returned or whether removals are recoverable, but it is largely sufficient for a two-parameter tool.

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 parameters are already fully documented. The description restates the default threshold and the close_tabs behavior, but adds no meaning beyond the schema baseline.

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 a clear verb and resource: remove stale terminal sessions that have been inactive. It distinguishes this from general session closing via the 'stale' and 'accumulated tabs' framing, though it does not explicitly name sibling tools like close_session or list_sessions.

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 clear usage context: 'Use periodically to clean up accumulated tabs.' This tells the agent when the tool is appropriate, but it does not name alternatives or exclusions, such as when to prefer close_session for individual sessions.

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