Skip to main content
Glama

bootstrap_internal_agent

Initialize development workflows by converting triggers from GitHub, Slack, or Linear into structured context, creating recall packs, preparing sandbox environments, and generating execution plans.

Instructions

Normalize a GitHub/Slack/Linear trigger into startup context, construct a recall pack, prepare a git worktree sandbox, and emit an execution plus reviewer-lane plan.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYes
repoPathNo
prepareSandboxNo
sandboxRootNo
intentIdNo
contextNo
mcpProfileNo
partnerProfileNo
delegationModeNo
approvedNo
triggerNo
threadNo
taskNo
commentsNo
messagesNo

Implementation Reference

  • The core implementation of the bootstrapInternalAgent function, which handles context normalization, sandbox preparation, and intent planning.
    function bootstrapInternalAgent(options = {}) {
      const invocation = normalizeInvocation(options);
      const startupContext = buildStartupContext(invocation);
    
      ensureContextFs();
      const recallPack = constructContextPack({
        query: buildRecallQuery(invocation),
        maxItems: 6,
        maxChars: 5000,
      });
    
      const sandbox = invocation.prepareSandbox
        ? ensureWorktreeSandbox({
          repoPath: invocation.repoPath,
          sandboxRoot: invocation.sandboxRoot,
          threadId: invocation.threadId,
        })
        : {
          ready: false,
          kind: 'none',
          path: null,
          reused: false,
          baseRef: null,
        };
    
      const plan = planIntent({
        intentId: invocation.intentId,
        context: startupContext.text,
        mcpProfile: invocation.mcpProfile,
        partnerProfile: invocation.partnerProfile,
        delegationMode: invocation.delegationMode,
        approved: invocation.approved,
        repoPath: sandbox.path || invocation.repoPath || undefined,
      });
    
      const reviewerLane = buildReviewerLane(plan);
      const codeGraphSection = formatCodeGraphRecallSection(plan.codegraphImpact);
      const middlewarePlan = buildMiddlewarePlan({
        sandbox,
        recallPack,
        plan,
        reviewerLane,
      });
    
      const payload = {
        generatedAt: new Date().toISOString(),
        invocation: {
          source: invocation.source,
          trigger: invocation.trigger,
          thread: invocation.thread,
          threadId: invocation.threadId,
          task: invocation.task,
          repoPath: invocation.repoPath,
          prepareSandbox: invocation.prepareSandbox,
          intentId: invocation.intentId,
          mcpProfile: invocation.mcpProfile || 'default',
          delegationMode: invocation.delegationMode,
        },
        startupContext,
        recallPack: summarizePack(recallPack),
        sandbox,
        intentPlan: plan,
        reviewerLane,
        middlewarePlan,
        codeGraph: {
          enabled: Boolean(codeGraphSection),
          section: codeGraphSection,
        },
      };
    
      recordProvenance({
        type: 'internal_agent_bootstrap_created',
        source: invocation.source,
        threadId: invocation.threadId,
        sandboxPath: sandbox.path,
        intentId: plan.intent.id,
        delegationEligible: plan.delegationEligible,
        packId: recallPack.packId,
      });
    
      return payload;
    }
  • Registration of the 'bootstrap_internal_agent' tool in the tool registry.
    name: 'bootstrap_internal_agent',
    description: 'Normalize a GitHub/Slack/Linear trigger into startup context, construct a recall pack, prepare a git worktree sandbox, and emit an execution plus reviewer-lane plan.',
  • MCP server request handler route for 'bootstrap_internal_agent'.
    case 'bootstrap_internal_agent':
      return toTextResult(bootstrapInternalAgent(args));

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