Skip to main content
Glama

Sweep Idle Sessions

session_sweep
Idempotent

Finalize stale sessions idle for at least 24 hours by marking them aborted or max-rounds, and optionally purge old corrupt quarantine entries.

Instructions

Finalize unfinished sessions whose metadata has been idle for at least 24 hours. The terminal reason accepts at most 200 characters. v3.7.5 (B1): opt-in prune_corrupt also removes stale entries from the corrupt_sessions/ quarantine directory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
callerNooperator
reasonNostale
outcomeNoaborted
idle_minutesNo
prune_corruptNo
response_formatNojson
corrupt_min_age_daysNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Addedv4.4.12
  2. Removedv4.4.11
  3. First observedv4.4.8

TDQS

A3.8/5.0
Behavior3/5

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

The annotations declare readOnlyHint=false (so it's a state-changing operation), idempotentHint=true (safe to retry), and destructiveHint=false. The description adds useful context by noting the prune_corrupt option removes entries from quarantine, which is a subtle destructive-ish behavior not covered by annotations. However, it doesn't detail what 'finalize' does to the underlying session state beyond that, or whether there are side effects on related data. It adds some value but the bar is lower because annotations carry the safety profile.

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 extremely concise — three sentences total, and the first sentence is front-loaded with the core purpose. The version note and prune_corrupt detail are placed at the end, which is good structure. Every sentence adds value; no fluff or repetition of schema fields.

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?

For a tool with 7 parameters and 0% parameter documentation, the description is notably incomplete. It covers the idle condition and the prune_corrupt feature, but doesn't explain the meaning of 'outcome', 'response_format', or 'corrupt_min_age_days' — these are critical for correct invocation. The lack of an output schema means the description must also hint at return values, which it doesn't. Overall, an agent could call it safely with defaults but can't make informed customizations without external knowledge.

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?

Schema description coverage is 0% — the description provides NO parameter-level explanation. With 7 parameters and 0% coverage, the description should compensate, but it doesn't. It only mentions the reason max length and the prune_corrupt option, leaving idle_minutes, outcome, response_format, corrupt_min_age_days, and caller completely undocumented. An agent cannot know the meaning or effect of most parameters without opening the schema, and even then the schema only shows types/enums, not semantics like when to change defaults.

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 ('Finalize'), a specific resource ('unfinished sessions'), and a precise triggering condition (idle ≥24 hours). It also mentions the terminal reason length limit and the optional prune_corrupt behavior, which adds specificity beyond just naming the action. This clarity distinguishes it from other session tools (which focus on other lifecycle steps like init, list, read).

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 clearly implies this tool is for finalizing idle sessions — the idle condition (24 hours) and the mention of 'unfinished sessions' give the agent clear context on when to call it. It does not explicitly name sibling alternatives or exclusion conditions, but the context is strong enough that an agent can infer when this tool is appropriate versus session_init/session_read/session_finalize.

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

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/LCV-Ideas-Software/cross-review'

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