{"record":{"id":"5675b1f00bd2c27b","repo":"vercel/ai","slug":"anthropic-message-batches-cannot-restore-the-custo","errorCode":null,"errorMessage":"Anthropic Message Batches cannot restore the custom provider-tool name \"${aliasedProviderTool.name}\" when results are retrieved independently of the start call (request \"${request.id}\"). Use the provider's canonical tool name.","messagePattern":"Anthropic Message Batches cannot restore the custom provider-tool name \"(.+?)\" when results are retrieved independently of the start call \\(request \"(.+?)\"\\)\\. Use the provider's canonical tool name\\.","errorType":"exception","errorClass":"UnsupportedFunctionalityError","httpStatus":null,"severity":"error","filePath":"packages/anthropic/src/anthropic-messages-batch.ts","lineNumber":244,"sourceCode":"        stream: false,\n        userSuppliedBetas: new Set(explicitBatchBetas),\n      });\n      if (prepared.usesJsonResponseTool) {\n        throw new UnsupportedFunctionalityError({\n          functionality: 'batch responseFormat JSON-tool fallback',\n          message:\n            `Anthropic Message Batches cannot decode the JSON-tool structured-output fallback ` +\n            `(request \"${request.id}\") because batch results are retrieved independently of the start call. ` +\n            `Use a model that supports native output_format structured outputs.`,\n        });\n      }\n      const aliasedProviderTool = request.options.tools?.find(\n        tool =>\n          tool.type === 'provider' &&\n          prepared.toolNameMapping.toProviderToolName(tool.name) !== tool.name,\n      );\n      if (aliasedProviderTool != null) {\n        throw new UnsupportedFunctionalityError({\n          functionality: 'aliased provider tool names in batches',\n          message:\n            `Anthropic Message Batches cannot restore the custom provider-tool name ` +\n            `\"${aliasedProviderTool.name}\" when results are retrieved independently of the start call ` +\n            `(request \"${request.id}\"). Use the provider's canonical tool name.`,\n        });\n      }\n      const body = this.transformRequestBody(prepared.args, prepared.betas);\n      validateAnthropicBatchBody({\n        body,\n        requestId: request.id,\n      });\n\n      preparedRequests.push({ custom_id: request.id, params: body });\n      for (const beta of prepared.betas) {\n        batchBetas.add(beta);\n      }\n      for (const warning of prepared.warnings) {","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/anthropic/src/anthropic-messages-batch.ts#L226-L262","documentation":"Error \"Anthropic Message Batches cannot restore the custom provider-tool name \"${aliasedProviderTool.name}\" when results are retrieved independently of the start call (request \"${request.id}\"). Use the provider's canonical tool name.\" thrown in vercel/ai.","triggerScenarios":"Thrown at packages/anthropic/src/anthropic-messages-batch.ts:244 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}