Skip to main content
Glama

board_get_handoff

Retrieve the full handoff context for a project mid-session to re-check pending tasks or provide context to background agents without starting a new session.

Instructions

Read the full handoff context for a project without starting a new session. board_create_session already returns this automatically at session start — use board_get_handoff mid-session when you need to re-check what was pending, or when a background agent needs context without claiming the session slot. Returns: project (id/name/status/description), last_session (progress_summary + handoff_notes + context_artifacts from the most recent completed/abandoned session, or null if none), active_tasks (all non-done tasks sorted critical → low priority, with id/title/status/priority/assigned_agent/riper_mode/depends_on), active_task_count, and recent_activity (last 20 activity_log entries, newest-first).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesProject ID (from board_get_projects) to read handoff context for.

Implementation Reference

  • The board_get_handoff tool handler: calls buildHandoffContext(db, project_id) and returns the result as JSON.
      async ({ project_id }) => {
        const handoff = await buildHandoffContext(db, project_id);
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(handoff, null, 2),
            },
          ],
        };
      }
    );
  • buildHandoffContext helper: queries Firestore for project info, last completed/abandoned session, active non-done tasks (sorted by priority), and recent activity (last 20 entries).
    async function buildHandoffContext(db: Firestore, project_id: string) {
      // Get project info
      const projectSnap = await db.collection("projects").doc(project_id).get();
      const projectData = projectSnap.exists ? projectSnap.data() : null;
    
      // Get last completed or abandoned session
      const lastSessionSnap = await db
        .collection("sessions")
        .where("project_id", "==", project_id)
        .where("status", "in", ["completed", "abandoned"])
        .orderBy("ended_at", "desc")
        .limit(1)
        .get();
    
      const lastSession = lastSessionSnap.docs[0]
        ? (() => {
            const data = lastSessionSnap.docs[0].data();
            return {
              id: lastSessionSnap.docs[0].id,
              status: data.status,
              progress_summary: data.progress_summary,
              handoff_notes: data.handoff_notes,
              context_artifacts: data.context_artifacts,
              started_at: data.started_at?.toDate?.()?.toISOString() ?? null,
              ended_at: data.ended_at?.toDate?.()?.toISOString() ?? null,
            };
          })()
        : null;
    
      // Get all non-done tasks sorted by priority
      const tasksSnap = await db
        .collection("tasks")
        .where("project_id", "==", project_id)
        .where("status", "!=", "done")
        .get();
    
      const priorityOrder: Record<string, number> = {
        critical: 0,
        high: 1,
        medium: 2,
        low: 3,
      };
    
      const activeTasks = tasksSnap.docs
        .map((doc) => {
          const data = doc.data();
          return {
            id: doc.id,
            title: data.title,
            status: data.status,
            priority: data.priority,
            assigned_agent: data.assigned_agent,
            riper_mode: data.riper_mode,
            depends_on: data.depends_on,
          };
        })
        .sort(
          (a, b) =>
            (priorityOrder[a.priority] ?? 99) - (priorityOrder[b.priority] ?? 99)
        );
    
      // Get recent activity
      const activitySnap = await db
        .collection("activity_log")
        .orderBy("created_at", "desc")
        .limit(20)
        .get();
    
      // Filter to project-related activity (tasks in this project or sessions in this project)
      const taskIds = new Set(tasksSnap.docs.map((d) => d.id));
      const recentActivity = activitySnap.docs
        .map((doc) => {
          const data = doc.data();
          return {
            id: doc.id,
            action: data.action,
            agent_name: data.agent_name,
            details: data.details,
            task_id: data.task_id,
            session_id: data.session_id,
            created_at: data.created_at?.toDate?.()?.toISOString() ?? null,
          };
        });
    
      return {
        project: projectData
          ? {
              id: project_id,
              name: projectData.name,
              status: projectData.status,
              description: projectData.description,
            }
          : null,
        last_session: lastSession,
        active_tasks: activeTasks,
        active_task_count: activeTasks.length,
        recent_activity: recentActivity,
      };
    }
  • Registration of the 'board_get_handoff' tool on the MCP server with its description and Zod schema for project_id.
    server.tool(
      "board_get_handoff",
      "Read the full handoff context for a project without starting a new session. board_create_session already returns this automatically at session start — use board_get_handoff mid-session when you need to re-check what was pending, or when a background agent needs context without claiming the session slot. Returns: project (id/name/status/description), last_session (progress_summary + handoff_notes + context_artifacts from the most recent completed/abandoned session, or null if none), active_tasks (all non-done tasks sorted critical → low priority, with id/title/status/priority/assigned_agent/riper_mode/depends_on), active_task_count, and recent_activity (last 20 activity_log entries, newest-first).",
      {
        project_id: z.string().describe("Project ID (from board_get_projects) to read handoff context for."),
      },
      async ({ project_id }) => {
        const handoff = await buildHandoffContext(db, project_id);
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(handoff, null, 2),
            },
          ],
        };
      }
    );
  • src/index.ts:30-30 (registration)
    Call to registerSessionTools which registers board_get_handoff (and board_create_session) on the MCP server.
    registerSessionTools(server, db);
  • Input schema: requires project_id (string) described as 'Project ID (from board_get_projects) to read handoff context for.'
      project_id: z.string().describe("Project ID (from board_get_projects) to read handoff context for."),
    },
Behavior4/5

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

No annotations provided, but description comprehensively lists returned fields. Does not disclose side effects or limitations, but for a read operation this is sufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is informative and well-structured, front-loading purpose and usage. Slightly lengthy but every sentence 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?

Covers purpose, usage, and return shape thoroughly. No output schema but description details fields. Lacks error or rate limit info, but acceptable for a read tool.

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?

Only one parameter with schema coverage 100%. Schema already describes it well; description adds no extra meaning beyond indicating it reads handoff context.

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 reads handoff context for a project without starting a new session. It distinguishes from board_create_session, providing a specific verb and resource.

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

Usage Guidelines5/5

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

Explicitly says when to use: mid-session to re-check pending items or for background agents without claiming a session slot. Contrasts with board_create_session for session start.

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/HuntsDesk/ve-vibe-board'

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