Skip to main content
Glama

notify_session_progress

Send progress updates from AFK Mode to mobile clients during active sessions. Use categories like milestone, error, or info to communicate task status while away from your desk.

Instructions

Sends a progress update to the connected mobile client. Only call this when AFK mode is active (afkMode: true and clientConnected: true). Returns immediately. Use category 'milestone' for significant steps, 'error' for failures, 'info' for routine updates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesThe session ID
summaryYesShort human-readable summary
detailNoExtended detail (shown in detailed verbosity)
categoryYesCategory of the progress update
progressNoOptional structured progress
filesChangedNoOptional list of files touched
toolsUsedNoOptional list of tools called

Implementation Reference

  • The main handler for 'notify_session_progress' tool. Registers the tool with MCP server, defines Zod input schema (sessionId, summary, detail, category, progress, filesChanged, toolsUsed), creates a ProgressHistoryEntry, adds it to session history via addProgressEntry(), sends WebSocket update via sendProgressUpdate(), and triggers push notifications for error/milestone categories.
    // ── notify_session_progress ──
    server.tool(
      "notify_session_progress",
      "Sends a progress update to the connected mobile client. Only call this when AFK mode is active (afkMode: true and clientConnected: true). Returns immediately. Use category 'milestone' for significant steps, 'error' for failures, 'info' for routine updates.",
      {
        sessionId: z.string().describe("The session ID"),
        summary: z.string().describe("Short human-readable summary"),
        detail: z
          .string()
          .nullable()
          .optional()
          .describe("Extended detail (shown in detailed verbosity)"),
        category: z
          .enum(["info", "warning", "error", "success", "milestone"])
          .describe("Category of the progress update"),
        progress: z
          .object({
            current: z.number(),
            total: z.number(),
            label: z.string(),
          })
          .nullable()
          .optional()
          .describe("Optional structured progress"),
        filesChanged: z.array(z.string()).optional().describe("Optional list of files touched"),
        toolsUsed: z.array(z.string()).optional().describe("Optional list of tools called"),
      },
      async (args) => {
        const id = crypto.randomUUID();
        const timestamp = new Date().toISOString();
    
        const entry: ProgressHistoryEntry = {
          id,
          timestamp,
          summary: args.summary,
          detail: args.detail ?? null,
          category: args.category,
          progress: args.progress ?? null,
          filesChanged: args.filesChanged ?? [],
          toolsUsed: args.toolsUsed ?? [],
        };
        addProgressEntry(entry);
    
        const msg: ProgressUpdateMessage = {
          type: "progress_update",
          ...entry,
        };
        const delivered = sendProgressUpdate(msg);
    
        // Push notification for critical updates
        if (args.category === "error" || args.category === "milestone") {
          await sendPushNotification(
            args.category === "error" ? "⚠️ Error" : "🎯 Milestone",
            args.summary,
          );
        }
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({ delivered }),
            },
          ],
        };
      },
    );
  • ProgressUpdateMessage type definition - the message structure sent to the mobile client. Contains type, id, timestamp, summary, detail, category, progress, filesChanged, and toolsUsed fields.
    export interface ProgressUpdateMessage {
      type: "progress_update";
      id: string;
      timestamp: string;
      summary: string;
      detail: string | null;
      category: ProgressCategory;
      progress: ProgressInfo | null;
      filesChanged: string[];
      toolsUsed: string[];
    }
  • NotifyProgressInput interface - defines the input type for the notify_session_progress tool with sessionId, summary, detail, category, progress, filesChanged, and toolsUsed fields.
    export interface NotifyProgressInput {
      sessionId: string;
      summary: string;
      detail?: string | null;
      category: ProgressCategory;
      progress?: ProgressInfo | null;
      filesChanged?: string[];
      toolsUsed?: string[];
    }
  • sendProgressUpdate helper function - wraps sendToClient to send the ProgressUpdateMessage to the connected WebSocket client. Returns boolean indicating delivery status.
    export function sendProgressUpdate(update: ProgressUpdateMessage): boolean {
      return sendToClient(update);
    }
  • addProgressEntry helper function - adds a ProgressHistoryEntry to the session's progressHistory array for tracking all progress updates.
    export function addProgressEntry(entry: ProgressHistoryEntry): void {
      getSession().progressHistory.push(entry);
    }

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/paulbennet/afk-mode-mcp'

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