update_item
Edit an existing DynamoDB table item's attributes or insert a new item if the key is absent, using update expressions and optional conditions.
Instructions
Edits an existing item's attributes, or adds a new item to the table if it does not already exist.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"table_name": "<table_name>",
"key": "<key>"
},
"name": "update_item"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | The primary key of an item. Must use DynamoDB attribute value format (see IMPORTANT note about DynamoDB Attribute Value Format). | |
| table_name | Yes | Table Name or Amazon Resource Name (ARN) | |
| region_name | No | The aws region to run the tool | |
| update_expression | No | Defines the attributes to be updated, the action to be performed on them, and new value(s) for them. The following actions are available: * SET - Adds one or more attributes and values to an item. If any of these attributes already exist, they are replaced by the new values. * REMOVE - Removes one or more attributes from an item. * ADD - Only supports Number and Set data types. Adds a value to a number attribute or adds elements to a set. * DELETE - Only supports Set data type. Removes elements from a set. For example: 'SET a=:value1, b=:value2 DELETE :value3, :value4, :value5' | |
| condition_expression | No | A condition that must be satisfied in order for a conditional update to succeed. | |
| expression_attribute_names | No | Substitution tokens for attribute names in an expression. | |
| expression_attribute_values | No | Values that can be substituted in an expression. Must use DynamoDB attribute value format (see IMPORTANT note about DynamoDB Attribute Value Format). |