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],
    }));
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions scanning with filters but doesn't disclose critical behavioral traits: whether this is a read-only operation, performance implications of scanning entire tables, pagination behavior, error conditions, or authentication requirements. For a table scanning operation with no annotation coverage, this leaves significant gaps in understanding tool behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single sentence that communicates the core functionality efficiently. Every word earns its place: 'Scans' (action), 'entire table' (resource and scope), 'with optional filters' (key capability). No wasted words or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a database scanning operation with 5 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what scanning returns, performance implications, error handling, or how this differs from query operations. For a potentially resource-intensive table operation, more context about behavior and limitations is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 5 parameters thoroughly. The description adds minimal value beyond the schema - it mentions 'optional filters' which aligns with filterExpression, expressionAttributeNames, and expressionAttributeValues parameters, but doesn't provide additional context about filter syntax, performance tradeoffs, or relationship between parameters. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Scans an entire table with optional filters' clearly states the verb ('scans') and resource ('table'), but is somewhat vague about scope ('entire' vs 'filtered') and doesn't distinguish from sibling tools like 'query_table' or 'get_item'. It provides basic purpose but lacks specificity about what scanning entails compared to alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives like 'query_table' or 'get_item'. The description mentions 'optional filters' but doesn't explain when filtering is appropriate or what distinguishes scanning from querying. Without usage context, the agent must infer based on tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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