Skip to main content
Glama

get_session_changes

Retrieve all changes logged in a session to review prior modifications. Use at session start to understand what was done previously.

Instructions

Retrieve all changes logged in the current session. Use at session start to understand what was done previously.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYes

Implementation Reference

  • The actual execution logic for get_session_changes: reads the ledger file via fs.readLedger, filters entries by sessionId, and returns results with branch and shortSha from git context.
    async function getSessionChanges(sessionId: string): Promise<LedgerQueryResult> {
      const [entries, context] = await Promise.all([
        fs.readLedger(ledgerPath),
        git.getBranchContext(repoDir),
      ]);
    
      return {
        entries: entries.filter((e) => e.sessionId === sessionId),
        branch: context.branch,
        sha: context.shortSha,
      };
    }
  • Zod schema for get_session_changes input validation: requires a sessionId string.
    export const GetSessionChangesSchema = z.object({
      sessionId: z.string().min(1),
    });
  • Registration of the 'get_session_changes' tool on the MCP server with its schema and handler that calls manager.getSessionChanges.
    server.tool('get_session_changes', 'Retrieve all changes logged in the current session. Use at session start to understand what was done previously.', GetSessionChangesSchema.shape, async (args) => {
      const result = await manager.getSessionChanges(args.sessionId);
      return {
        content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }],
      };
    });
  • Helper function readLedger that reads and parses the ledger file (used by getSessionChanges handler).
    async function readLedger(ledgerPath: string): Promise<LedgerEntry[]> {
      if (!existsSync(ledgerPath)) return [];
      const raw = await readFile(ledgerPath, 'utf8');
      return raw
        .trim()
        .split('\n')
        .filter(Boolean)
        .map((line) => JSON.parse(line) as LedgerEntry);
    }
Behavior2/5

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

No annotations present. Description only says 'Retrieve', implying read-only, but does not explicitly confirm non-destructive nature or explain what 'changes' entails.

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?

Two concise sentences front-load the purpose and usage without unnecessary words.

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?

Given no output schema, description fails to explain return format or content of changes. No mention of sibling tools like log_change or get_all_changes to provide context.

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

Parameters2/5

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

Schema has 0% description coverage for sessionId. Description mentions 'current session' but does not clarify how sessionId relates or how to obtain it, leaving ambiguity.

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 it retrieves all changes in the current session, differentiating it somewhat from sibling 'get_all_changes' by specifying session scope, but could be more explicit.

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

Usage Guidelines3/5

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

It advises using at session start to understand previous work, providing context, but lacks when-not-to use or alternatives like get_all_changes.

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/2loch-ness6/mempalace-mcp-dev'

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