Skip to main content
Glama

trw_pre_compact_checkpoint

Prevent workflow disruption by capturing a safety checkpoint before context compaction. Supply directive and context anchor to resume exactly where you left off.

Instructions

Capture a safety checkpoint before the context window compacts.

Use when:

  • Invoked by the PreCompact hook on imminent context compaction.

  • You suspect compaction is near and want a clean resume point on disk.

PRD-CORE-165 FR-01: pass directive (the active operator directive / task you are mid-flight on) and context_anchor (where you are in it — e.g. the in-flight experiment or handoff pointer). These live in the conversation, not in trw state, so they cannot be auto-derived; when supplied they are persisted into the pre-compact state and surfaced on the next trw_session_start so the post-compaction session resumes exactly instead of re-orienting by hand. Both are optional and backward-compatible.

Best-effort: sub-step failures populate status but do not raise.

Output: PreCompactResultDict with fields {status: "written"|"skipped"|"error", reason?: str, checkpoint_path?: str, instructions_path?: str, compact_state_path?: str, directive?: str, context_anchor?: str}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directiveNo
context_anchorNo
Behavior5/5

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

No annotations exist, but the description fully covers behavior: it is best-effort (sub-step failures populate status without raising), explains output fields, and notes parameters are conversation-derived. There is no contradiction with absent annotations.

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 well-structured with clear sections (purpose, usage, parameter explanation, best-effort note, output format). Every sentence is informative, and it is front-loaded with the core purpose.

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

Completeness5/5

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

Given no annotations, no output schema, and high complexity, the description is extremely complete: it covers purpose, usage context, parameter semantics, behavior, and output structure. No significant gaps remain.

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

Parameters5/5

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

Schema coverage is 0%, yet the description explains both 'directive' and 'context_anchor' in detail: their purpose, why they cannot be auto-derived, and that they are optional. This adds substantial meaning beyond the schema.

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 'Capture a safety checkpoint before the context window compacts' with a specific verb and resource. It differentiates from siblings like 'trw_checkpoint' and 'trw_session_start' by focusing on the pre-compaction scenario.

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

Usage Guidelines5/5

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

Explicit 'Use when:' conditions are provided: invoked by PreCompact hook or when compaction is suspected. This gives clear guidance on when to invoke the tool.

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/wallter/trw-mcp'

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