vercel/ai · error · UnsupportedFunctionalityError

tool choice type: ${_exhaustiveCheck}

Error message

tool choice type: ${_exhaustiveCheck}

What it means

Error "tool choice type: ${_exhaustiveCheck}" thrown in vercel/ai.

Source

Thrown at packages/anthropic/src/anthropic-prepare-tools.ts:440

        betas,
      };
    case 'none':
      // Anthropic does not support 'none' tool choice, so we remove the tools:
      return { tools: undefined, toolChoice: undefined, toolWarnings, betas };
    case 'tool':
      return {
        tools: anthropicTools,
        toolChoice: {
          type: 'tool',
          name: toolChoice.toolName,
          disable_parallel_tool_use: disableParallelToolUse,
        },
        toolWarnings,
        betas,
      };
    default: {
      const _exhaustiveCheck: never = type;
      throw new UnsupportedFunctionalityError({
        functionality: `tool choice type: ${_exhaustiveCheck}`,
      });
    }
  }
}

View on GitHub (pinned to 69428b1f8b)

When it happens

Trigger: Thrown at packages/anthropic/src/anthropic-prepare-tools.ts:440 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/50d65953806ff56c. Report an issue: GitHub.