Skip to main content
Glama

handoff

Pause automation to complete sensitive steps like 2FA, payments, or configuration changes. Human resolves in browser, then resumes the process.

Instructions

Pause and ask the human to complete the next step manually (2FA, payment, sensitive config). Returns a paused state — the human resolves it in the browser, then tells Claude to continue.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reasonYes

Implementation Reference

  • The handoff tool handler function. Writes a pause message to stderr asking the human to complete a step manually (e.g., 2FA, payment), then returns a paused state with an instruction for the agent to wait and call screenshot() after the human signals completion.
    async function handoff(args: { reason: string }) {
      // Surface to stderr so it's visible in the terminal where the user can react.
      process.stderr.write(
        `\n[helm] ⏸ HANDOFF: ${args.reason}\n` +
        `Complete this in your browser, then ask Claude to continue.\n\n`
      );
      return {
        paused: true,
        reason: args.reason,
        instruction:
          'The agent is paused. The human will complete this step manually in the browser. ' +
          'After they say to continue, call screenshot() to verify the new state.',
      };
    }
  • Input schema / tool definition for 'handoff'. Declares a string 'reason' (required) field that describes why the handoff is needed.
    {
      name: 'handoff',
      description:
        'Pause and ask the human to complete the next step manually (2FA, payment, sensitive ' +
        'config). Returns a paused state — the human resolves it in the browser, then tells Claude to continue.',
      inputSchema: {
        type: 'object',
        properties: { reason: { type: 'string' } },
        required: ['reason'],
      },
    },
  • src/index.ts:455-472 (registration)
    Dispatch/call-site registration. The CallToolRequestSchema handler uses a switch statement on the tool name; 'handoff' case calls handoff() with the { reason } argument extracted from the request.
    server.setRequestHandler(CallToolRequestSchema, async (req) => {
      const name = req.params.name;
      const args = (req.params.arguments ?? {}) as Record<string, unknown>;
      try {
        let result: unknown;
        switch (name) {
          case 'attach':       result = await attach(args as { port?: number }); break;
          case 'list_tabs':    result = await listTabs(); break;
          case 'focus_tab':    result = await focusTab(args as { index?: number; urlContains?: string }); break;
          case 'screenshot':   result = await screenshot(args as { fullPage?: boolean }); break;
          case 'inspect':      result = await inspect(); break;
          case 'click':        result = await click(args as { id?: number; text?: string; selector?: string }); break;
          case 'type':         result = await type(args as { text: string; id?: number; selector?: string; submit?: boolean }); break;
          case 'navigate':     result = await navigate(args as { url: string }); break;
          case 'wait_for':     result = await waitFor(args as { text?: string; selector?: string; timeoutMs?: number }); break;
          case 'handoff':      result = await handoff(args as { reason: string }); break;
          default:             throw new Error(`Unknown tool: ${name}`);
        }
  • Handoff pattern triggers — a list of regex patterns and human-readable labels for prompts (2FA, CAPTCHA, payment, login, etc.) that when detected in page text, auto-suggest a handoff via the handoffTriggers field returned by screenshot().
    // Patterns that should auto-trigger a handoff suggestion when seen on screen.
    // Keep these tight — false positives would be more annoying than helpful.
    const HANDOFF_PATTERNS: Array<[RegExp, string]> = [
      [/2-?step verification/i, '2FA prompt'],
      [/verify it'?s you/i, 'identity verification'],
      [/enter (the )?(verification |security )?code/i, 'verification code'],
      [/recaptcha|i'?m not a robot/i, 'CAPTCHA'],
      [/cvv|cvc|security code/i, 'payment confirmation'],
  • detectHandoffTriggers helper function — scans a text string against HANDOFF_PATTERNS and returns a list of matching trigger labels. Used by the screenshot tool to surface handoff-relevant prompts to the AI.
    function detectHandoffTriggers(text: string): string[] {
      const found = new Set<string>();
      for (const [rx, label] of HANDOFF_PATTERNS) {
        if (rx.test(text)) found.add(label);
      }
      return [...found];
    }
Behavior4/5

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

With no annotations, the description explains the tool returns a paused state and that the human resolves it in the browser before continuing. This adequately discloses the non-automated, interactive behavior.

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 sentences with no filler. The first sentence states the action and examples, the second explains the result. 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 the tool's simplicity and lack of output schema, the description covers the main use case and return behavior. However, it does not mention what happens if the human fails to complete the step, which would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, meaning nothing in the schema describes the 'reason' parameter. The description only hints at usage ('for 2FA, payment, sensitive config') but does not explain the parameter's format, expected input, or provide examples.

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 verb 'pause and ask' clearly describes the action, and 'human to complete the next step manually' specifies the resource and context. This distinguishes it from sibling tools like click or type, which perform automated actions.

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

Usage Guidelines4/5

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

The description explicitly lists use cases (2FA, payment, sensitive config) and implies that other tools are for automated steps. While it doesn't explicitly say 'when not to use', the examples provide clear context.

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/flying-pisces/mcp-helm'

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