Amazon Web Services · sdk · fg-0173

DynamoDB DocumentClient put throws Pass options.removeUndefinedValues=true to remove undefined values

Error: Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.

Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100

Cause

The v3 marshaller refuses undefined values by default instead of dropping them. The option is set when you create the document client, not per call.

Fix

Create the document client with removeUndefinedValues true, or strip undefined fields before the write.

Apply

import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';
const ddb = DynamoDBDocumentClient.from(new DynamoDBClient({}), {
  marshallOptions: { removeUndefinedValues: true },
});

Affects: @aws-sdk/lib-dynamodb and @aws-sdk/util-dynamodb, all v3 releases

Sources

Have your agent know this before it fails

claude mcp add --transport http footgun https://getfootgun.com/api/mcp