Skip to main content
Glama

agentbay_session_handoff

Transfer context to the next agent by documenting completed steps, blockers, key decisions, and files modified. Structured handoff ensures continuity and clarity across sessions.

Instructions

Write structured handoff context for the next agent. Includes completed steps, blockers, key decisions, and files modified.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID
summaryYesSummary of what you accomplished
taskIdNo
nextStepsNo
completedStepsNo
blockersNo
filesModifiedNo
keyDecisionsNo

Implementation Reference

  • src/index.ts:520-551 (registration)
    Registration of the 'agentbay_session_handoff' tool via server.tool(), including its Zod schema definition for inputs (projectId, summary, taskId, nextSteps, completedSteps, blockers, filesModified, keyDecisions).
    // Tool 23: Session Handoff
    server.tool(
      'agentbay_session_handoff',
      'Write structured handoff context for the next agent. Includes completed steps, blockers, key decisions, and files modified.',
      {
        projectId: z.string().describe('Project ID'),
        summary: z.string().describe('Summary of what you accomplished'),
        taskId: z.string().optional(),
        nextSteps: z.array(z.string()).optional(),
        completedSteps: z.array(z.string()).optional(),
        blockers: z.array(z.object({
          description: z.string(),
          severity: z.enum(['LOW', 'MEDIUM', 'HIGH', 'CRITICAL']).optional(),
          suggestedFix: z.string().optional(),
        })).optional(),
        filesModified: z.array(z.string()).optional(),
        keyDecisions: z.array(z.object({
          decision: z.string(),
          rationale: z.string(),
          alternatives: z.array(z.string()).optional(),
        })).optional(),
      },
      async ({ projectId, ...handoffData }) => {
        const data = await apiPost(`/api/v1/projects/${projectId}/activity/handoff`, {
          ...handoffData,
          context: {},
        });
        if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] };
        return { content: [{ type: 'text' as const, text: `Handoff recorded.\nHandoff ID: ${data.handoffId}\n\nNext agent can resume with agentbay_session_resume.` }] };
      }
    );
  • Handler function for agentbay_session_handoff: posts handoff data to /api/v1/projects/{projectId}/activity/handoff and returns the handoff ID.
      async ({ projectId, ...handoffData }) => {
        const data = await apiPost(`/api/v1/projects/${projectId}/activity/handoff`, {
          ...handoffData,
          context: {},
        });
        if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] };
        return { content: [{ type: 'text' as const, text: `Handoff recorded.\nHandoff ID: ${data.handoffId}\n\nNext agent can resume with agentbay_session_resume.` }] };
      }
    );
  • Input schema for agentbay_session_handoff using Zod, defining projectId (required string), summary (required string), and optional fields: taskId, nextSteps, completedSteps, blockers (with severity and suggestedFix), filesModified, and keyDecisions (with rationale and alternatives).
    {
      projectId: z.string().describe('Project ID'),
      summary: z.string().describe('Summary of what you accomplished'),
      taskId: z.string().optional(),
      nextSteps: z.array(z.string()).optional(),
      completedSteps: z.array(z.string()).optional(),
      blockers: z.array(z.object({
        description: z.string(),
        severity: z.enum(['LOW', 'MEDIUM', 'HIGH', 'CRITICAL']).optional(),
        suggestedFix: z.string().optional(),
      })).optional(),
      filesModified: z.array(z.string()).optional(),
      keyDecisions: z.array(z.object({
        decision: z.string(),
        rationale: z.string(),
        alternatives: z.array(z.string()).optional(),
      })).optional(),
    },
Behavior2/5

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

No annotations provided, so description carries full burden. Barely discloses behavior: only notes it writes context including certain fields. No information on idempotency, side effects (e.g., overwriting), permissions, or rate limits.

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?

Two concise sentences with no fluff. Front-loaded with the tool's core purpose. Every word adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having 8 parameters and no output schema or annotations, the description is minimal. Does not address when to call (e.g., end of session), return format, or ordering of fields. Incomplete for a write tool with many parameters.

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 only 25% (projectId and summary documented). Description adds meaning by listing some array fields (completedSteps, blockers, keyDecisions, filesModified) but omits taskId and nextSteps. Partially compensates for low schema coverage but not fully.

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?

Clearly states verb 'write' and resource 'structured handoff context'. Mentions included fields (completed steps, blockers, key decisions, files modified). Distinct from sibling tools like agentbay_session_resume by name and description.

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?

No guidance on when to use this tool versus alternatives. Does not specify prerequisites or when not to use. Only states what it does, not the context or criteria for invocation.

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