Skip to main content
Glama

save_session

Save AI conversation sessions as organized Markdown files, automatically categorized by IDE and date for easy storage and retrieval.

Instructions

【保存会话】当用户说"保存当前会话"、"存储会话"、"记录对话"、"保存对话内容"等时调用。将AI对话内容保存为Markdown文件,按IDE/日期自动分类存储。

⚠️ 调用前必须执行的步骤:

  1. AI助手必须先在内部整理完整的对话历史

  2. 将所有用户问题和AI回答按时间顺序格式化

  3. 使用清晰的Markdown格式(# 用户、# AI助手等标题)

  4. 将整理好的完整对话作为content参数传入

❌ 禁止行为:

  • 禁止传入对话摘要或总结

  • 禁止遗漏任何历史问答

  • 禁止使用简化格式

✅ 正确格式示例:

用户

[第一个问题的完整内容...]

AI助手

[第一个回答的完整内容...]

用户

[第二个问题的完整内容...]

AI助手

[第二个回答的完整内容...]

触发词:保存、存储、记录、归档会话/对话/聊天

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
base_dirNo保存会话的基础目录路径(可选,优先级最高。未指定时依次使用: 环境变量MCP_SESSION_BASE_DIR > config.json配置 > 默认路径~/Documents/ide_sessions)
ide_nameYesIDE名称(如: Qoder, VSCode, Cursor, Windsurf, Claude等),用于分类存储
session_descriptionYes会话描述(简短概括本次对话的主题,如:实现用户登录功能、修复数据库bug等)
contentYes会话内容 - 必须是完整的原始对话记录,包含所有用户问题和AI回答。 ⚠️ 重要要求: 1. 必须包含从对话开始到现在的所有交互内容 2. 保持原始对话的完整性,不要总结或精简 3. 使用清晰的Markdown格式标记每轮对话 4. 保留代码块、列表、表格等所有格式 ✅ 标准格式: # 用户 [完整问题内容,包括所有细节] # AI助手 [完整回答内容,包括所有代码、解释、建议] # 用户 [下一个问题...] # AI助手 [下一个回答...] ❌ 错误示例: - "用户询问了关于X的问题,AI回答了Y"(这是总结,不是完整对话) - 只包含最近几轮对话(遗漏了历史内容)
session_timeNo会话时间(ISO 8601格式,可选,默认为当前时间)
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior including required pre-processing steps (整理完整的对话历史, 格式化, 使用清晰的Markdown格式), output format requirements, and specific constraints (禁止传入对话摘要或总结). However, it doesn't mention potential error conditions, file naming conventions, or what happens if the save operation fails.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (⚠️ 调用前必须执行的步骤, ❌ 禁止行为, ✅ 正确格式示例), but it's quite verbose with redundant information between the description body and the content parameter example. Some content could be more concise, particularly the formatting examples that duplicate information already implied by the requirements.

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

Completeness4/5

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

For a tool with no annotations and no output schema, the description provides substantial context about the tool's behavior, requirements, and constraints. It covers the critical aspects of what the tool does, when to use it, and how to prepare inputs. The main gap is the lack of information about what the tool returns or any error handling behavior.

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 100%, so the schema already documents all 5 parameters thoroughly. The description adds some context about the content parameter requirements (完整对话, Markdown格式), but doesn't provide additional semantic meaning beyond what's already in the schema descriptions. The baseline of 3 is appropriate when the schema does the heavy lifting.

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 the tool's purpose: '将AI对话内容保存为Markdown文件,按IDE/日期自动分类存储' (save AI conversation content as Markdown files, automatically categorized by IDE/date). It specifies the exact action (save), resource (conversation content), and output format (Markdown files with automatic categorization), distinguishing it from sibling tools like delete_session or list_sessions.

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?

The description provides explicit usage guidelines with trigger words ('保存、存储、记录、归档会话/对话/聊天'), prerequisites (internal formatting steps before calling), and prohibitions (禁止传入对话摘要或总结, 禁止遗漏任何历史问答). It clearly indicates when to use this tool versus alternatives by specifying the exact user prompts that should trigger it.

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/oscar-wang-xin/mcp-session-saver'

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