Skip to main content
Glama

agentbay_session_resume

Retrieve completed steps, blockers, key decisions, and recent failures from a previous agent session to resume work with full context.

Instructions

Read handoff context from a previous agent session. Includes completed steps, blockers, key decisions, and recent failures.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID
taskIdNo

Implementation Reference

  • src/index.ts:552-581 (registration)
    Registration of the 'agentbay_session_resume' tool on the MCP server using server.tool().
    // Tool 24: Session Resume
    server.tool(
      'agentbay_session_resume',
      'Read handoff context from a previous agent session. Includes completed steps, blockers, key decisions, and recent failures.',
      {
        projectId: z.string().describe('Project ID'),
        taskId: z.string().optional(),
      },
      async ({ projectId, taskId }) => {
        const params = new URLSearchParams();
        if (taskId) params.set('taskId', taskId);
        const data = await apiGet(`/api/v1/projects/${projectId}/activity/resume?${params.toString()}`);
        if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] };
        if (!data.handoff) return { content: [{ type: 'text' as const, text: 'No handoff context found.' }] };
    
        const h = data.handoff;
        let text = `# Session Handoff from ${h.fromAgentName || h.fromAgent || 'previous agent'}\n`;
        text += `Handoff at: ${h.handoffAt}\n\n## Summary\n${h.summary}\n`;
        if (h.completedSteps?.length) text += `\n## Completed\n${h.completedSteps.map((s: string) => `- [x] ${s}`).join('\n')}\n`;
        if (h.nextSteps?.length) text += `\n## Next Steps\n${h.nextSteps.map((s: string, i: number) => `${i + 1}. ${s}`).join('\n')}\n`;
        if (h.blockers?.length) text += `\n## Blockers\n${h.blockers.map((b: any) => `- [${b.severity || 'MEDIUM'}] ${b.description}`).join('\n')}\n`;
        if (h.keyDecisions?.length) text += `\n## Key Decisions\n${h.keyDecisions.map((d: any) => `- **${d.decision}**: ${d.rationale}`).join('\n')}\n`;
        if (h.filesModified?.length) text += `\n## Files Modified\n${h.filesModified.map((f: string) => `- ${f}`).join('\n')}\n`;
        if (data.recentFailures?.length) {
          text += `\n## Recent Failures (Don't Repeat)\n`;
          text += data.recentFailures.map((f: any) => `- **${f.title}**: ${f.content.substring(0, 200)}`).join('\n') + '\n';
        }
        return { content: [{ type: 'text' as const, text }] };
      }
    );
  • Input schema definition using Zod: requires projectId (string), optional taskId (string).
    'Read handoff context from a previous agent session. Includes completed steps, blockers, key decisions, and recent failures.',
    {
      projectId: z.string().describe('Project ID'),
      taskId: z.string().optional(),
    },
  • Handler function that calls GET /api/v1/projects/{projectId}/activity/resume, then formats the handoff context into readable text with summary, completed steps, next steps, blockers, key decisions, files modified, and recent failures.
      async ({ projectId, taskId }) => {
        const params = new URLSearchParams();
        if (taskId) params.set('taskId', taskId);
        const data = await apiGet(`/api/v1/projects/${projectId}/activity/resume?${params.toString()}`);
        if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] };
        if (!data.handoff) return { content: [{ type: 'text' as const, text: 'No handoff context found.' }] };
    
        const h = data.handoff;
        let text = `# Session Handoff from ${h.fromAgentName || h.fromAgent || 'previous agent'}\n`;
        text += `Handoff at: ${h.handoffAt}\n\n## Summary\n${h.summary}\n`;
        if (h.completedSteps?.length) text += `\n## Completed\n${h.completedSteps.map((s: string) => `- [x] ${s}`).join('\n')}\n`;
        if (h.nextSteps?.length) text += `\n## Next Steps\n${h.nextSteps.map((s: string, i: number) => `${i + 1}. ${s}`).join('\n')}\n`;
        if (h.blockers?.length) text += `\n## Blockers\n${h.blockers.map((b: any) => `- [${b.severity || 'MEDIUM'}] ${b.description}`).join('\n')}\n`;
        if (h.keyDecisions?.length) text += `\n## Key Decisions\n${h.keyDecisions.map((d: any) => `- **${d.decision}**: ${d.rationale}`).join('\n')}\n`;
        if (h.filesModified?.length) text += `\n## Files Modified\n${h.filesModified.map((f: string) => `- ${f}`).join('\n')}\n`;
        if (data.recentFailures?.length) {
          text += `\n## Recent Failures (Don't Repeat)\n`;
          text += data.recentFailures.map((f: any) => `- **${f.title}**: ${f.content.substring(0, 200)}`).join('\n') + '\n';
        }
        return { content: [{ type: 'text' as const, text }] };
      }
    );
Behavior3/5

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

No annotations are provided, so the description must carry the behavioral burden. It indicates a read-only operation by stating 'Read' and lists output contents, but omits safety, idempotency, or error behavior. It does not contradict any annotation.

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: one sentence plus a brief list. No filler or redundant information. Every word 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?

Given no output schema, the description explains what the tool returns (handoff context with steps, blockers, decisions, failures). It lacks details on error handling or missing session scenarios, but for a simple read tool it is fairly complete.

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 coverage is 50% (only projectId described). The description adds context by explaining the purpose (reading handoff context) but does not clarify the role of taskId or parameter relationships beyond what the schema provides. Baseline 3 is appropriate.

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 it 'Read handoff context from a previous agent session,' with a specific verb and resource. It lists included items (completed steps, blockers, key decisions, failures), distinguishing it from sibling tools like agentbay_session_handoff or agentbay_memory_recall.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like agentbay_memory_recall or agentbay_session_handoff. It does not mention prerequisites or when not to use it.

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/thomasjumper/agentbay-mcp'

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