Production-grade session context window tokenizer and compaction manager. Protects system prompt anchor tokens while applying FIFO rolling trim to intermediate dialogue.
Single tool with critical definition gaps. Tool name 'compact_session_window' lacks action verb prefix (should be 'compact_*' or similar). Description is present (58 chars) but minimal and lacks WHEN/WHY guidance. Input schema visible but incomplete: 'messages' param lacks type specification in the schema object itself (only in description), and 'max_token_budget' has a default but no min/max bounds documented. Output schema is completely undocumented, LLM cannot predict return structure. No error handling guidance. Tool does not follow pattern:tool-description or pattern:constrained-input standards.
Compacts agent conversation history within token budget.
Input schema lacks proper type definitions. 'messages' parameter is described as array but schema shows only 'type':'object' with properties, no explicit 'type':'array' in the schema JSON. 'max_token_budget' has no minimum/maximum bounds, allowing LLM to pass negative or absurdly large values.
Output schema completely undocumented. Tool returns a dict with 'compaction_id', 'max_token_budget', 'total_estimated_tokens', 'retained_messages_count', 'pruned_messages_count', 'system_anchor_preserved', 'compacted_session', but LLM has no schema to predict this structure. Violates pattern:tool requirement for documented return types.
Tool description is minimal (58 chars) and lacks actionable context. Does not explain WHEN to use (e.g., 'when conversation history exceeds token limits'), WHAT it returns, or HOW to interpret results. Baseline for A+ tools is 194 chars average; this is 30% of that.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 33 | 2026-07-28+ | v2 |
No error handling guidance. Tool silently uses default messages if none provided, but does not document this behavior or explain what happens if token estimation fails. No recovery guidance for edge cases (empty messages, zero budget, etc.).
Tool name 'compact_session_window' does not start with a clear action verb. Baseline shows 90% of A+ tools start with get, list, create, search, update, delete, send. 'compact' is acceptable but 'compact_session_window' is vague about what 'window' means. Consider 'compact_conversation_history' or 'trim_message_history'.