Skip to main content
Glama

Manage Session State

manage_session_state
Destructive

Persist current conversations with save or auto-save, merge new messages into archived history, export Markdown, delete with confirmation, and watch folders for new or modified files.

Instructions

Save, auto-save, merge, export or delete archived conversations, and watch the archive for changes. Use it to persist the current conversation; to import outside history use sync_workspace_data. action 'register_auto_save': remember conversation_name and messages so they are written when the client disconnects (call it early and re-call it to refresh). 'trigger_auto_save': write the registered session now. 'save': write messages to <conversation_name>.json, overwriting a chat with that name; below the auto_save_message_threshold (default 20) it is skipped unless force_save=true. 'merge': append new_messages to file_name, skipping duplicates. 'export_markdown': write exports/.md. 'delete': permanently delete file_name; refused unless confirm=true, so ask the user first. 'watch_folder': report {new_files, modified_files, total_tracked} since the last call (only updates the watch checkpoint). Returns a confirmation string, or the report object for 'watch_folder'.

Input Schema

NameRequiredDescriptionDefault
actionYesOperation to perform (see the tool description).
clientNoArchive namespace (a subfolder of the chats directory). Built-in: 'default', 'cursor', 'chatgpt', 'claude'; any other name creates its own subfolder. Omit to use 'default'.default
confirmNoMust be true for 'delete' to proceed; deletion is permanent.
messagesNoChat messages as objects with 'role' ('user', 'assistant' or 'system') and 'content' (text). 'text' is accepted in place of 'content'; extra keys such as 'timestamp' are kept.
file_nameNoExisting chat file for 'merge', 'export_markdown' and 'delete', such as 'my-chat.json'.
force_saveNoFor 'save': write even when the message count is below the auto-save threshold.
new_messagesNoMessages to append for 'merge' (same shape as 'messages'); falls back to 'messages'.
conversation_nameNoConversation title for 'save' and 'register_auto_save' (also the file name); used as file_name for other actions when file_name is omitted.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv1.6.2
    • addedInput schema / properties / action / description
      Added value: +"Operation to perform (see the tool description)."
    • addedInput schema / properties / action / enum
      Added value: +[
      +  "save",
      +  "register_auto_save",
      +  "trigger_auto_save",
      +  "watch_folder",
      +  "merge",
      +  "export_markdown",
      +  "delete"
      +]
    • addedInput schema / properties / client / description
      Added value: +"Archive namespace (a subfolder of the chats directory). Built-in: 'default', 'cursor', 'chatgpt', 'claude'; any other name creates its own subfolder. Omit to use 'default'."
    • addedInput schema / properties / confirm / description
      Added value: +"Must be true for 'delete' to proceed; deletion is permanent."
    • addedInput schema / properties / conversation_name / description
      Added value: +"Conversation title for 'save' and 'register_auto_save' (also the file name); used as file_name for other actions when file_name is omitted."
    • addedInput schema / properties / file_name / description
      Added value: +"Existing chat file for 'merge', 'export_markdown' and 'delete', such as 'my-chat.json'."
    • addedInput schema / properties / force_save / description
      Added value: +"For 'save': write even when the message count is below the auto-save threshold."
    • addedInput schema / properties / messages / description
      Added value: +"Chat messages as objects with 'role' ('user', 'assistant' or 'system') and 'content' (text). 'text' is accepted in place of 'content'; extra keys such as 'timestamp' are kept."
    • addedInput schema / properties / new_messages / description
      Added value: +"Messages to append for 'merge' (same shape as 'messages'); falls back to 'messages'."
  2. First observedv1.5.4

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and non-idempotent, and the description adds concrete consequences beyond them: delete is permanent and refused without confirm=true, save overwrites an existing chat of that name, saves below the default-20 threshold are silently skipped unless force_save, merge deduplicates, and watch_folder only advances the checkpoint. It also discloses the return shape for each path.

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?

Front-loads the overall scope and the sibling routing in the first two sentences, then switches to a compact per-action list with the action name as the anchor. Dense but zero filler; every clause carries a distinct behavioral fact.

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?

For an 8-parameter, seven-action mutation tool this covers what an agent needs: per-action effects, the destructive guardrail, threshold behavior, and return values (a confirmation string or the watch_folder report object). The output schema exists but the description still names the return shape, which is more than required.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description goes further by binding parameters to actions — force_save only matters for 'save', confirm only for 'delete', new_messages for 'merge', and conversation_name doubling as file_name when that is omitted. It does not cover the 'client' namespace parameter, which is left entirely to 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?

Opens with a specific set of verbs and the resource they act on ('Save, auto-save, merge, export or delete archived conversations... watch the archive for changes'), then enumerates all seven actions with what each writes. It explicitly carves out the boundary against the sibling sync_workspace_data for outside history, so an agent can choose between them without opening either schema.

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?

Gives per-action when-to-use guidance ('call it early and re-call it to refresh', 'trigger_auto_save: write the registered session now') and names the alternative tool plus the condition that selects it ('to import outside history use sync_workspace_data'). It also states a procedural precondition for the destructive path: ask the user before delete.

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