Skip to main content
Glama
imankamyabi

DynamoDB MCP Server

by imankamyabi

scan_table

Scan entire DynamoDB tables with optional filters, attribute mappings, and result limits using the DynamoDB MCP Server. Retrieve table data efficiently with customizable query parameters.

Instructions

Scans an entire table with optional filters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionAttributeNamesNoAttribute name mappings
expressionAttributeValuesNoValues for the filter expression
filterExpressionNoFilter expression
limitNoMaximum number of items to return
tableNameYesName of the table

Implementation Reference

  • The handler function that executes the DynamoDB ScanCommand on the specified table, with optional filter expression, attribute values, names, and limit.
    async function scanTable(params: any) { try { const command = new ScanCommand({ TableName: params.tableName, FilterExpression: params.filterExpression, ExpressionAttributeValues: params.expressionAttributeValues ? marshall(params.expressionAttributeValues) : undefined, ExpressionAttributeNames: params.expressionAttributeNames, Limit: params.limit, }); const response = await dynamoClient.send(command); return { success: true, message: `Scan executed successfully on table ${params.tableName}`, items: response.Items ? response.Items.map(item => unmarshall(item)) : [], count: response.Count, scannedCount: response.ScannedCount, }; } catch (error) { console.error("Error scanning table:", error); return { success: false, message: `Failed to scan table: ${error}`, }; } }
  • Defines the Tool object for scan_table, including name, description, and inputSchema.
    const SCAN_TABLE_TOOL: Tool = { name: "scan_table", description: "Scans an entire table with optional filters", inputSchema: { type: "object", properties: { tableName: { type: "string", description: "Name of the table" }, filterExpression: { type: "string", description: "Filter expression", optional: true }, expressionAttributeValues: { type: "object", description: "Values for the filter expression", optional: true }, expressionAttributeNames: { type: "object", description: "Attribute name mappings", optional: true }, limit: { type: "number", description: "Maximum number of items to return", optional: true }, }, required: ["tableName"], }, };
  • src/index.ts:638-640 (registration)
    Dispatcher switch case that registers and invokes the scanTable handler for the 'scan_table' tool name.
    case "scan_table": result = await scanTable(args); break;
  • src/index.ts:598-600 (registration)
    Registers SCAN_TABLE_TOOL in the list of available tools returned by ListToolsRequestHandler.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [CREATE_TABLE_TOOL, UPDATE_CAPACITY_TOOL, PUT_ITEM_TOOL, GET_ITEM_TOOL, QUERY_TABLE_TOOL, SCAN_TABLE_TOOL, DESCRIBE_TABLE_TOOL, LIST_TABLES_TOOL, CREATE_GSI_TOOL, UPDATE_GSI_TOOL, CREATE_LSI_TOOL, UPDATE_ITEM_TOOL], }));

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/imankamyabi/dynamodb-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server