Skip to main content
Glama

save_session

Save Claude Code development sessions to a database for tracking project conversations, summaries, and git commits to support Architecture Decision Records (ADR) creation.

Instructions

Save a Claude Code development session to the database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYesProject name
conversationYesFull conversation text
git_commitNoCurrent git commit hash
summaryNoShort session summary

Implementation Reference

  • index.js:58-69 (handler)
    Tool registration and handler definition for 'save_session' in index.js.
    server.registerTool('save_session', {
      description: 'Save a Claude Code development session to the database',
      inputSchema: {
        project:      z.string().describe('Project name'),
        conversation: z.string().describe('Full conversation text'),
        git_commit:   z.string().optional().describe('Current git commit hash'),
        summary:      z.string().optional().describe('Short session summary'),
      },
    }, async (args) => {
      const id = saveSession(args);
      return { content: [{ type: 'text', text: `Session saved (ID: ${id})` }] };
    });
  • db.js:54-59 (handler)
    Actual implementation of the 'saveSession' function that interacts with the database.
    export function saveSession({ project, conversation, git_commit, summary }) {
      const result = db.prepare(
        'INSERT INTO sessions (project, conversation, git_commit, summary) VALUES (?, ?, ?, ?)'
      ).run(project, conversation, git_commit ?? null, summary ?? null);
      return result.lastInsertRowid;
    }
Behavior2/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 states this is a save operation to a database, implying a write/mutation, but doesn't mention permission requirements, whether the operation is idempotent, what happens on conflicts, or any rate limits. This leaves significant gaps for a tool that modifies persistent state.

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 a single, focused sentence that efficiently communicates the core purpose without unnecessary words. It's appropriately sized and front-loaded with the essential information.

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

Completeness2/5

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

For a database write operation with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after saving (success/failure responses), whether the operation creates or updates records, or any behavioral characteristics. The combination of mutation tool + zero annotation coverage requires more comprehensive description.

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?

The description provides no additional parameter information beyond what's already documented in the schema (which has 100% coverage). It doesn't explain relationships between parameters, format expectations, or usage examples. The baseline score of 3 reflects adequate but minimal value added given the comprehensive schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Save') and resource ('Claude Code development session to the database'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from any potential sibling tools that might also save data, though none of the listed siblings appear to be direct alternatives.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or contextual constraints. It simply states what the tool does without indicating appropriate usage scenarios or exclusions.

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/wooxogh/adr-mcp-setup'

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