Skip to main content
Glama

start_handoff

Initiate sequential delegation from eligible intent plans by transferring context and approvals to designated profiles for continued execution.

Instructions

Start a sequential delegation handoff from a delegation-eligible intent plan

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
intentIdYes
contextNo
mcpProfileNo
bundleIdNo
partnerProfileNo
approvedNo
repoPathNo
delegateProfileNo
plannedChecksNo

Implementation Reference

  • The core implementation of the start_handoff logic.
    function startHandoff(params = {}) {
      const evaluation = evaluateDelegation({
        delegationMode: 'sequential',
        plan: params.plan,
        mcpProfile: params.mcpProfile,
        context: params.context,
        repoPath: params.repoPath,
        plannedChecks: params.plannedChecks,
      });
    
      if (String(params.mcpProfile || '').trim() === 'dispatch') {
        persistRejectedStart({
          taskKey: evaluation.taskKey,
          intentId: params.plan && params.plan.intent ? params.plan.intent.id : null,
          delegateProfile: null,
          mcpProfile: params.mcpProfile,
          partnerProfile: params.partnerProfile,
          reasonCode: 'dispatch_profile',
          reason: 'Dispatch MCP profile may not start handoffs.',
          context: params.context,
          repoPath: params.repoPath,
        });
        throw createDelegationError('Dispatch MCP profile may not start handoffs.', 403);
      }
    
      if (String(params.mcpProfile || '').trim() === 'locked') {
        persistRejectedStart({
          taskKey: evaluation.taskKey,
          intentId: params.plan && params.plan.intent ? params.plan.intent.id : null,
          delegateProfile: null,
          mcpProfile: params.mcpProfile,
          partnerProfile: params.partnerProfile,
          reasonCode: 'locked_profile',
          reason: 'Locked MCP profile may not start handoffs.',
          context: params.context,
          repoPath: params.repoPath,
        });
        throw createDelegationError('Locked MCP profile may not start handoffs.', 403);
      }
    
      if (!evaluation.delegationEligible || evaluation.executionMode !== 'sequential_delegate') {
        persistRejectedStart({
          taskKey: evaluation.taskKey,
          intentId: params.plan && params.plan.intent ? params.plan.intent.id : null,
          delegateProfile: evaluation.delegateProfile,
          mcpProfile: params.mcpProfile,
          partnerProfile: params.partnerProfile,
          reasonCode: evaluation.reasonCode,
          reason: evaluation.delegationReason,
          context: params.context,
          repoPath: params.repoPath,
        });
        throw createDelegationError(evaluation.delegationReason, evaluation.reasonCode === 'unresolved_handoff_exists' ? 409 : 422, {
          reasonCode: evaluation.reasonCode,
        });
      }
  • Tool registration for start_handoff.
    destructiveTool({
      name: 'start_handoff',
      description: 'Start a sequential delegation handoff from a delegation-eligible intent plan',
      inputSchema: {
        type: 'object',
        required: ['intentId'],
        properties: {
          intentId: { type: 'string' },
          context: { type: 'string' },
          mcpProfile: { type: 'string' },
          bundleId: { type: 'string' },
          partnerProfile: { type: 'string' },
          approved: { type: 'boolean' },
          repoPath: { type: 'string' },
          delegateProfile: { type: 'string' },
          plannedChecks: { type: 'array', items: { type: 'string' } },
        },
      },
  • MCP tool handler routing for start_handoff in server-stdio.js.
    case 'start_handoff':
      return toTextResult(startHandoff({
        plan: planIntent({
          intentId: args.intentId,
          context: args.context || '',
          mcpProfile: args.mcpProfile,
          bundleId: args.bundleId,
          partnerProfile: args.partnerProfile,
          delegationMode: 'sequential',
          approved: args.approved === true,
          repoPath: args.repoPath,
        }),

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/IgorGanapolsky/mcp-memory-gateway'

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