Skip to main content
Glama

tracker_session_diff

Read-onlyIdempotent

Show changes since a timestamp, returning counts by action and entity type with key highlights. Use at session start to catch up on activity since last session.

Instructions

Show what changed since a given timestamp. Returns aggregated summary with counts by action and entity type, plus highlights of key changes. Call this at the start of a session to understand what happened since the last one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sinceYesISO 8601 datetime — show changes after this time (e.g. "2026-02-21T15:00:00")

Implementation Reference

  • The handler function `handleSessionDiff` that executes the tracker_session_diff tool logic. It queries activity_log since a given timestamp, aggregates by action and entity type, extracts highlights, and returns the full result.
    function handleSessionDiff(args: Record<string, unknown>) {
      const db = getDb();
      const since = args.since as string;
    
      const rows = db
        .prepare('SELECT * FROM activity_log WHERE created_at >= ? ORDER BY created_at ASC')
        .all(since) as Array<Record<string, unknown>>;
    
      const now = new Date().toISOString().replace('T', ' ').slice(0, 19);
    
      // Aggregate by action
      const summary: Record<string, number> = { created: 0, updated: 0, status_changed: 0, deleted: 0 };
      // Aggregate by entity_type -> action
      const byEntity: Record<string, Record<string, number>> = {};
    
      const highlights: string[] = [];
    
      for (const row of rows) {
        const action = row.action as string;
        const entityType = row.entity_type as string;
    
        summary[action] = (summary[action] ?? 0) + 1;
    
        if (!byEntity[entityType]) {
          byEntity[entityType] = { created: 0, updated: 0, status_changed: 0, deleted: 0 };
        }
        byEntity[entityType][action] = (byEntity[entityType][action] ?? 0) + 1;
    
        // Pick out highlights: status changes, creates, and deletes
        if (action === 'status_changed' || action === 'created' || action === 'deleted') {
          if (row.summary) highlights.push(row.summary as string);
        }
      }
    
      return {
        since,
        until: now,
        total_changes: rows.length,
        summary,
        by_entity_type: byEntity,
        highlights,
        activity: rows,
      };
    }
  • The tool definition/schema for 'tracker_session_diff' including its name, description, annotations, and inputSchema (requires `since` string).
    {
      name: 'tracker_session_diff',
      description:
        'Show what changed since a given timestamp. Returns aggregated summary with counts by action and entity type, plus highlights of key changes. Call this at the start of a session to understand what happened since the last one.',
      annotations: { title: 'Session Diff', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
      inputSchema: {
        type: 'object',
        properties: {
          since: {
            type: 'string',
            description: 'ISO 8601 datetime — show changes after this time (e.g. "2026-02-21T15:00:00")',
          },
        },
        required: ['since'],
      },
    },
  • The handlers export mapping the tool name 'tracker_session_diff' to the handleSessionDiff function.
    export const handlers: Record<string, ToolHandler> = {
      activity_log: handleActivityLog,
      tracker_session_diff: handleSessionDiff,
      task_batch_update: handleTaskBatchUpdate,
    };
Behavior4/5

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

Annotations already mark it read-only and idempotent. The description adds useful behavioral details: aggregated summary with counts and highlights, no side effects mentioned. No contradiction.

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?

Three concise sentences. Purpose, return format, and usage advice are front-loaded with no redundancy.

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?

Given no output schema, the description fully explains what is returned. Parameter is well-covered. The tool's purpose and context (session start) are clear.

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 already provides full description for the only parameter (ISO 8601 datetime). The description does not add extra semantic nuance beyond 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?

The description clearly states the tool returns changes since a timestamp, with specific outputs (counts, highlights). It distinguishes itself from sibling tools like activity_log by focusing on session-level summary.

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?

Explicitly advises calling at session start to understand previous changes. Does not list alternatives but context is clear enough for most agents.

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/spranab/saga-mcp'

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