vercel/ai · error · UnsupportedFunctionalityError
unsupported tool content part type: ${contentPart.type}
Error message
unsupported tool content part type: ${contentPart.type} What it means
The tool-result content converter throws UnsupportedFunctionalityError for any content part whose type is not one of the handled kinds (text, file, etc.). Bedrock's Converse API only supports a fixed set of tool result content block types, so unknown part types are rejected at conversion time.
Source
Thrown at packages/amazon-bedrock/src/convert-to-amazon-bedrock-chat-messages.ts:473
),
name: contentPart.filename
? stripFileExtension(contentPart.filename)
: generateDocumentName(),
source: {
bytes: convertToBase64(
contentPart.data.data,
),
},
...(enableCitations && {
citations: { enabled: true },
}),
},
};
}
}
}
default: {
throw new UnsupportedFunctionalityError({
functionality: `unsupported tool content part type: ${contentPart.type}`,
});
}
}
}),
);
break;
}
case 'text':
case 'error-text':
toolResultContent = [{ text: output.value }];
break;
case 'execution-denied':
toolResultContent = [
{ text: output.reason ?? 'Tool call execution denied.' },
];
break;
case 'json':View on GitHub (pinned to 69428b1f8b)
Solutions
- Only return 'text' (and supported 'file') content parts from tools when using Bedrock.
- Convert unsupported part types to text (e.g. describe or serialize the content) before returning them.
- Upgrade @ai-sdk/amazon-bedrock in case support for the part type was added.
- If images are needed, return them as message content parts rather than tool result parts.
Example fix
// before
{ role: 'tool', content: [{ type: 'image', image: bytes }] }
// after
{ role: 'tool', content: [{ type: 'text', text: 'Screenshot captured (see description)...' }] } Defensive patterns
Strategy: validation
Validate before calling
const BEDROCK_TOOL_RESULT_PART_TYPES = new Set(['text', 'file']);
function validateToolResultContent(content) {
for (const part of content) {
if (!BEDROCK_TOOL_RESULT_PART_TYPES.has(part.type)) {
throw new Error(`Part type '${part.type}' unsupported in Bedrock tool results`);
}
}
} Type guard
function isBedrockToolResultPart(part) {
return part.type === 'text' || part.type === 'file';
} Try / catch
try {
await generateText({ model, messages });
} catch (error) {
if (UnsupportedFunctionalityError.isInstance(error) && error.message.includes('unsupported tool content part type')) {
console.error('Tool emitted a part type Bedrock cannot represent; serialize it to text.');
}
throw error;
} Prevention
- Restrict tool return shapes to text (and supported file) parts for Bedrock deployments.
- Normalize tool outputs with a provider-specific adapter before returning them.
- Check release notes when upgrading the SDK for new tool result part types.
When it happens
Trigger: Including a content part of an unhandled type (e.g. 'image' or a future/custom part type) inside a tool result's content array when targeting Bedrock.
Common situations: Tool results written for another provider (which may accept images or richer parts) are reused with Bedrock; or SDK version drift introduces new part types the converter does not handle yet.
Related errors
- tool result file data of type "${contentPart.data.type}"
- Unsupported task type: ${taskType}
- URL-based images are not supported for Amazon Bedrock image
- AI_UnsupportedFunctionalityError
- Multiple system messages that are separated by user/assistan
AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30).
Data as JSON: /api/errors/3f3a7ef4bd0a8cab.
Report an issue: GitHub.