Skip to main content
Glama

activity_log

Read-onlyIdempotent

Review recent changes by filtering entity type, action, or date. Track progress and see what happened since your last session.

Instructions

View the activity log showing what changed and when. Useful for understanding recent progress or reviewing what happened since the last session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entity_typeNoFilter by entity type
entity_idNoFilter by specific entity
actionNoFilter by action type
sinceNoISO 8601 datetime - show only activity after this time
limitNo

Implementation Reference

  • The main handler function for the activity_log tool. Queries the activity_log table with optional filters (entity_type, entity_id, action, since) and returns results ordered by created_at DESC.
    function handleActivityLog(args: Record<string, unknown>) {
      const db = getDb();
      const entityType = args.entity_type as string | undefined;
      const entityId = args.entity_id as number | undefined;
      const action = args.action as string | undefined;
      const since = args.since as string | undefined;
      const limit = (args.limit as number) ?? 50;
    
      const whereClauses: string[] = [];
      const params: unknown[] = [];
    
      if (entityType) {
        whereClauses.push('entity_type = ?');
        params.push(entityType);
      }
      if (entityId !== undefined) {
        whereClauses.push('entity_id = ?');
        params.push(entityId);
      }
      if (action) {
        whereClauses.push('action = ?');
        params.push(action);
      }
      if (since) {
        whereClauses.push('created_at > ?');
        params.push(since);
      }
    
      const whereStr = whereClauses.length > 0 ? `WHERE ${whereClauses.join(' AND ')}` : '';
      const sql = `SELECT * FROM activity_log ${whereStr} ORDER BY created_at DESC LIMIT ?`;
      params.push(limit);
    
      return db.prepare(sql).all(...params);
    }
  • Input schema for the activity_log tool defining optional filters: entity_type (enum), entity_id (integer), action (enum), since (ISO 8601 string), and limit (integer, default 50).
      type: 'object',
      properties: {
        entity_type: {
          type: 'string',
          enum: ['project', 'epic', 'task', 'subtask', 'note'],
          description: 'Filter by entity type',
        },
        entity_id: { type: 'integer', description: 'Filter by specific entity' },
        action: {
          type: 'string',
          enum: ['created', 'updated', 'deleted', 'status_changed'],
          description: 'Filter by action type',
        },
        since: { type: 'string', description: 'ISO 8601 datetime - show only activity after this time' },
        limit: { type: 'integer', default: 50 },
      },
    },
  • Handler registry mapping 'activity_log' string to the handleActivityLog function.
    export const handlers: Record<string, ToolHandler> = {
      activity_log: handleActivityLog,
      tracker_session_diff: handleSessionDiff,
      task_batch_update: handleTaskBatchUpdate,
    };
  • src/index.ts:37-49 (registration)
    Top-level handler registration spreading activityHandlers (which includes activity_log) into the ALL_HANDLERS map.
    const ALL_HANDLERS: Record<string, (args: Record<string, unknown>) => unknown> = {
      ...projectHandlers,
      ...epicHandlers,
      ...taskHandlers,
      ...subtaskHandlers,
      ...noteHandlers,
      ...commentHandlers,
      ...templateHandlers,
      ...dashboardHandlers,
      ...searchHandlers,
      ...activityHandlers,
      ...exportImportHandlers,
    };
  • Helper function that inserts a row into the activity_log table. Used by other tools (tasks, projects, epics, etc.) to log changes.
    export function logActivity(
      db: Database.Database,
      entityType: string,
      entityId: number,
      action: string,
      fieldName: string | null,
      oldValue: string | null,
      newValue: string | null,
      summary: string
    ): void {
      db.prepare(
        `INSERT INTO activity_log (entity_type, entity_id, action, field_name, old_value, new_value, summary)
         VALUES (?, ?, ?, ?, ?, ?, ?)`
      ).run(entityType, entityId, action, fieldName, oldValue, newValue, summary);
    }
Behavior4/5

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

Annotations already indicate read-only and idempotent behavior. The description adds meaningful context about what the tool shows ('what changed and when'), going beyond the structured data. No contradictions.

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 two sentences with no fluff, front-loading the action and purpose. Every phrase adds value.

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 simple read-only log with 5 parameters and no output schema, the description covers the key use case (reviewing changes) and hints at practical application ('since the last session'). It could mention return format but is otherwise sufficient.

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 high (80%), so baseline is 3. The description does not add parameter-specific semantics beyond what the schema already provides.

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 with a specific verb ('View') and resource ('activity log'), and distinguishes it from sibling tools by focusing on chronological changes.

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?

The description provides implied usage context ('useful for understanding recent progress') but does not explicitly state when not to use or suggest alternatives among siblings like 'tracker_session_diff'.

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