Skip to main content
Glama

save_context

Save a cognitive checkpoint for handoff to another agent or your future self.

The `description` is the primary cognitive payload — its narrative is what
lets another agent resume the work. The server also runs hybrid search on
the description and attaches the most relevant memories to the checkpoint.

Reference memories inside `description` using either:
  - `memory_id: <uuid>`  — reliable, direct lookup
  - `'descriptive phrase'`  — best-effort search; may not resolve

Prefer UUIDs whenever you have them. The response reports
`references_resolved` + `unresolved_references` so you can retry.

For the full hygiene guide (what to include, how to organize, when to
checkpoint, example shapes), invoke the `checkpoint_protocol` MCP prompt.

Args:
    name: Unique identifier for this checkpoint (used by restore_context).
    description: Narrative handoff with optional memory references.
    ctx: MCP context (automatically provided).

Returns:
    Dict with success status, context_id, memories_included, and (when
    references were extracted) references_resolved + unresolved_references.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
descriptionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Discloses beyond annotations: explains hybrid search on description, memory attachment behavior, reference resolution reporting, and return values. Annotations already indicate write operation and open world, but description adds significant behavioral context.

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?

Well-structured with clear sections (purpose, reference syntax, returns). Some redundancy (e.g., repeated mention of hybrid search) but overall efficient.

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?

Comprehensive for a complex handoff tool: covers purpose, reference resolution, error reporting, and points to external resources. Output schema exists, but description still adds value.

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?

Despite 0% schema coverage, the description contains a detailed Args section explaining both parameters, including valid usage of memory references and default values. Fully compensates for missing schema descriptions.

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 it saves a cognitive checkpoint for handoff, with a specific verb ('save'), resource ('context'), and purpose. It distinguishes from siblings like 'restore_context'.

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?

Explicitly states when to use (handoff to another agent or future self) and provides guidelines for memory references (UUIDs vs phrases). Mentions a separate prompt for full hygiene guide, but lacks explicit when-not-to-use guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.