dynamodb_update_ttl
Enable or disable Time to Live (TTL) settings for a DynamoDB table by specifying the table name, TTL status, and attribute name.
Instructions
Update the TTL settings for a table
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table_name | Yes | Name of the DynamoDB table | |
| ttl_attribute | Yes | The attribute name to use for TTL | |
| ttl_enabled | Yes | Whether TTL should be enabled |
Implementation Reference
- src/mcp_server_aws/server.py:212-219 (handler)The core handler logic for the dynamodb_update_ttl tool, which calls update_time_to_live on the DynamoDB client with the provided table name, enabled flag, and attribute name.elif name == "dynamodb_update_ttl": response = dynamodb_client.update_time_to_live( TableName=arguments["table_name"], TimeToLiveSpecification={ 'Enabled': arguments["ttl_enabled"], 'AttributeName': arguments["ttl_attribute"] } )
- src/mcp_server_aws/tools.py:401-422 (schema)Defines the Tool object including name, description, and input schema for validating arguments to dynamodb_update_ttl.Tool( name="dynamodb_update_ttl", description="Update the TTL settings for a table", inputSchema={ "type": "object", "properties": { "table_name": { "type": "string", "description": "Name of the DynamoDB table" }, "ttl_enabled": { "type": "boolean", "description": "Whether TTL should be enabled" }, "ttl_attribute": { "type": "string", "description": "The attribute name to use for TTL" } }, "required": ["table_name", "ttl_enabled", "ttl_attribute"] } ),
- src/mcp_server_aws/server.py:136-140 (registration)Registers the list_tools handler which returns all AWS tools including dynamodb_update_ttl via get_aws_tools().async def list_tools() -> list[Tool]: """List available AWS tools""" logger.debug("Handling list_tools request") return get_aws_tools()
- src/mcp_server_aws/server.py:358-360 (registration)Dispatches calls to dynamodb_* tools, including dynamodb_update_ttl, to the handle_dynamodb_operations function.return await handle_s3_operations(aws, name, arguments) elif name.startswith("dynamodb_"): return await handle_dynamodb_operations(aws, name, arguments)