Skip to main content
Glama

Sweep Stale Agents

sweep_stale_agents

Retires abandoned agents in your project using conservative inactivity thresholds while preserving your own agent and agents with active file reservations.

Instructions

Retire abandoned agents in the caller's project using the server's conservative inactivity heuristic. The caller is never retired, the threshold has a 60-second floor, and active file reservations block retirement by default.

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": {
      "project_key": "<project_key>",
      "agent_name": "<agent_name>"
    },
    "name": "sweep_stale_agents"
  }
}

Input Schema

NameRequiredDescriptionDefault
agent_nameYes
project_keyYes
threshold_secondsNo
registration_tokenNo
require_no_active_reservationsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.5
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observedv0.3.4

TDQS

B3.4/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 burden and does disclose meaningful behavior: a conservative server-side heuristic, self-exclusion of the caller, a 60-second threshold floor, and reservation-blocking by default. It omits whether retirement is reversible, what happens to the agent's messages/reservations, and whether registration_token implies an authorization requirement.

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?

A single tight sentence whose three clauses each convey a distinct constraint, with the core action front-loaded. Slightly dense but no filler.

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 destructive bulk-retirement tool with no annotations and no parameter documentation, the description covers the important safety constraints but leaves reversibility, authorization, and the registration_token's role unexplained. An output schema exists, so return-value detail is appropriately omitted.

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 0% across five parameters, so the description must compensate. It adds real meaning for threshold_seconds (60-second floor) and require_no_active_reservations (default behavior), but says nothing about registration_token, the 86400-second default, or what agent_name represents relative to the caller.

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 names a specific verb and resource ('Retire abandoned agents') scoped to 'the caller's project', which is far more precise than the title alone. It does not explicitly distinguish itself from siblings like retire_agent, deregister_agent, or hard_delete_agent, so the agent must infer that this is the bulk/heuristic variant.

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

Usage Guidelines3/5

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

Usage context is implied by 'abandoned agents' and the inactivity heuristic, and two important guardrails are given (the caller is never retired, active reservations block retirement). However, there is no explicit when-not-to-use guidance and no named alternative for retiring a single known agent.

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