Skip to main content
Glama

log_change

Record code changes with session, model, files affected, description, and reason to maintain a persistent change ledger for cross-session coherence.

Instructions

Log a code change to the persistent change ledger. Models MUST call this after modifying files. Enables cross-session coherence.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYes
modelYes
filesAffectedYes
descriptionYes
reasonYes
tagsNo
conductorTrackNo
conductorTaskNo

Implementation Reference

  • Core handler function that creates a LedgerEntry with context (branch, SHA from git), generates a unique ID, and appends it to the ledger file via FileSystemAccess.
    async function logChange(input: LogChangeInput): Promise<LedgerEntry> {
      const context = await git.getBranchContext(repoDir);
      const entry: LedgerEntry = {
        id: `chg_${randomUUID().replace(/-/g, '').slice(0, 12)}`,
        timestamp: new Date().toISOString(),
        branch: context.branch,
        sha: context.sha,
        sessionId: input.sessionId,
        model: input.model,
        filesAffected: input.filesAffected,
        description: input.description,
        reason: input.reason,
        tags: input.tags ?? [],
        conductorTrack: input.conductorTrack,
        conductorTask: input.conductorTask,
      };
    
      await fs.appendLedgerEntry(ledgerPath, entry);
      return entry;
    }
  • Zod schema for the log_change tool input: sessionId, model, filesAffected, description, reason, and optional tags/conductorTrack/conductorTask.
    export const LogChangeSchema = z.object({
      sessionId: z.string().min(1),
      model: z.string().min(1),
      filesAffected: z.array(z.string()).min(1),
      description: z.string().min(1),
      reason: z.string().min(1),
      tags: z.array(z.string()).optional(),
      conductorTrack: z.string().optional(),
      conductorTask: z.string().optional(),
    });
  • Registers the 'log_change' tool on the MCP server with its description, schema, and the async callback that delegates to manager.logChange().
    server.tool('log_change', 'Log a code change to the persistent change ledger. Models MUST call this after modifying files. Enables cross-session coherence.', LogChangeSchema.shape, async (args) => {
      const entry = await manager.logChange(args);
      return {
        content: [{ type: 'text' as const, text: JSON.stringify(entry, null, 2) }],
      };
    });
  • TypeScript interface defining the LogChangeInput type used by the logChange handler.
    export interface LogChangeInput {
      sessionId: string;
      model: string;
      filesAffected: string[];
      description: string;
      reason: string;
      tags?: string[];
      conductorTrack?: string;
      conductorTask?: string;
    }
  • Low-level helper that serializes a LedgerEntry as JSON and writes it as a new line (append) to the ledger file.
    async function appendLedgerEntry(ledgerPath: string, entry: LedgerEntry): Promise<void> {
      const line = JSON.stringify(entry) + '\n';
      await writeFile(ledgerPath, line, { flag: 'a', encoding: 'utf8' });
    }
Behavior3/5

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

With no annotations provided, the description carries full behavioral burden. It implies a write operation but does not disclose side effects, idempotency, or error conditions. The phrase 'persistent change ledger' suggests append-only behavior, but this is not explicit.

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 extremely concise: two sentences that front-load the main purpose. Every word earns its place, with no redundancy or fluff.

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?

Despite reasonable purpose clarity, the description lacks detail on the ledger's behavior, return value, and parameter semantics. Given the tool's complexity (8 params, no output schema), it is insufficiently complete for correct agent invocation.

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 description coverage is 0%, yet the description adds no meaning for any of the 8 parameters. Critical fields like 'filesAffected' and 'description' are unexplained, leaving the agent to infer from names alone.

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 action ('Log a code change') and the resource ('persistent change ledger'), specifying that models MUST call this after modifying files for cross-session coherence. This distinguishes it clearly from read-only sibling tools like 'get_all_changes'.

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?

The description explicitly states when to use the tool: 'Models MUST call this after modifying files.' It provides clear context for usage but does not mention when not to use it or list alternatives among siblings.

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