dynamodb_item_scan
Scan and retrieve items from a DynamoDB table using filter expressions and attribute values. Designed for AWS MCP Server to enable efficient data querying and management through natural language commands.
Instructions
Scan items in a DynamoDB table
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expression_attributes | No | ||
| filter_expression | No | Filter expression | |
| table_name | Yes | Name of the DynamoDB table |
Implementation Reference
- src/mcp_server_aws/server.py:247-260 (handler)Core handler logic for the 'dynamodb_item_scan' tool. Constructs scan parameters from arguments, including optional filter expression and expression attribute names/values, and executes the DynamoDB scan operation.elif name == "dynamodb_item_scan": scan_params = {"TableName": arguments["table_name"]} if "filter_expression" in arguments: scan_params["FilterExpression"] = arguments["filter_expression"] if "expression_attributes" in arguments: attrs = arguments["expression_attributes"] if "names" in attrs: scan_params["ExpressionAttributeNames"] = attrs["names"] if "values" in attrs: scan_params["ExpressionAttributeValues"] = attrs["values"] response = dynamodb_client.scan(**scan_params)
- src/mcp_server_aws/tools.py:294-323 (schema)Input schema definition for the 'dynamodb_item_scan' tool, part of the Tool object used for registration.name="dynamodb_item_scan", description="Scan items in a DynamoDB table", inputSchema={ "type": "object", "properties": { "table_name": { "type": "string", "description": "Name of the DynamoDB table" }, "filter_expression": { "type": "string", "description": "Filter expression" }, "expression_attributes": { "type": "object", "properties": { "values": { "type": "object", "description": "Expression attribute values" }, "names": { "type": "object", "description": "Expression attribute names" } } } }, "required": ["table_name"] } ),
- src/mcp_server_aws/server.py:136-140 (registration)Server registration point for all AWS tools via list_tools handler, which returns the list including 'dynamodb_item_scan' from get_aws_tools().async def list_tools() -> list[Tool]: """List available AWS tools""" logger.debug("Handling list_tools request") return get_aws_tools()