Skip to main content
Glama
imankamyabi

DynamoDB MCP Server

by imankamyabi

create_table

Design and configure new DynamoDB tables by specifying table name, partition key, sort key, and provisioned read/write capacity units through the DynamoDB MCP Server.

Instructions

Creates a new DynamoDB table with specified configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
partitionKeyYesName of the partition key
partitionKeyTypeYesType of partition key (S=String, N=Number, B=Binary)
readCapacityYesProvisioned read capacity units
sortKeyNoName of the sort key (optional)
sortKeyTypeNoType of sort key (optional)
tableNameYesName of the table to create
writeCapacityYesProvisioned write capacity units

Implementation Reference

  • Executes the create_table tool by constructing a DynamoDB CreateTableCommand based on input parameters (table name, keys, capacity) and sending it to the client, returning success/error response.
    async function createTable(params: any) {
      try {
        const command = new CreateTableCommand({
          TableName: params.tableName,
          AttributeDefinitions: [
            { AttributeName: params.partitionKey, AttributeType: params.partitionKeyType },
            ...(params.sortKey ? [{ AttributeName: params.sortKey, AttributeType: params.sortKeyType }] : []),
          ],
          KeySchema: [
            { AttributeName: params.partitionKey, KeyType: "HASH" as const },
            ...(params.sortKey ? [{ AttributeName: params.sortKey, KeyType: "RANGE" as const }] : []),
          ],
          ProvisionedThroughput: {
            ReadCapacityUnits: params.readCapacity,
            WriteCapacityUnits: params.writeCapacity,
          },
        });
        
        const response = await dynamoClient.send(command);
        return {
          success: true,
          message: `Table ${params.tableName} created successfully`,
          details: response.TableDescription,
        };
      } catch (error) {
        console.error("Error creating table:", error);
        return {
          success: false,
          message: `Failed to create table: ${error}`,
        };
      }
    }
  • Input schema definition for the create_table tool, validating parameters such as tableName, partitionKey, capacities, and optional sortKey.
    inputSchema: {
      type: "object",
      properties: {
        tableName: { type: "string", description: "Name of the table to create" },
        partitionKey: { type: "string", description: "Name of the partition key" },
        partitionKeyType: { type: "string", enum: ["S", "N", "B"], description: "Type of partition key (S=String, N=Number, B=Binary)" },
        sortKey: { type: "string", description: "Name of the sort key (optional)" },
        sortKeyType: { type: "string", enum: ["S", "N", "B"], description: "Type of sort key (optional)" },
        readCapacity: { type: "number", description: "Provisioned read capacity units" },
        writeCapacity: { type: "number", description: "Provisioned write capacity units" },
      },
      required: ["tableName", "partitionKey", "partitionKeyType", "readCapacity", "writeCapacity"],
    },
  • src/index.ts:598-600 (registration)
    Registers the create_table tool (as CREATE_TABLE_TOOL) among the list of available tools served in response to ListToolsRequestSchema.
    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],
    }));
  • src/index.ts:608-610 (registration)
    Registers the handler dispatch for create_table tool calls within the CallToolRequestSchema switch statement.
    case "create_table":
      result = await createTable(args);
      break;
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'specified configuration' but fails to explain critical behaviors like whether this is a mutating operation, what permissions are required, if it's idempotent, or what happens on conflicts. For a creation tool with zero annotation coverage, this leaves significant gaps in understanding its 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 a single, efficient sentence that directly states the tool's function without unnecessary words. It's appropriately sized and front-loaded, making it easy to understand quickly with zero wasted content.

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?

For a complex table creation tool with 7 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what the tool returns, error conditions, or behavioral nuances, leaving too much unspecified for proper agent usage despite the comprehensive parameter schema.

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?

The schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional parameter semantics beyond implying configuration is needed, which doesn't provide value beyond what the schema offers. This meets the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the action ('Creates') and resource ('new DynamoDB table'), making the purpose evident. However, it doesn't differentiate from sibling tools like 'create_gsi' or 'create_lsi' that also create DynamoDB structures, leaving some ambiguity about when to choose this specific tool.

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?

The description provides no guidance on when to use this tool versus alternatives like 'create_gsi' or 'create_lsi', nor does it mention prerequisites or context for table creation. It simply states what it does without indicating appropriate scenarios or exclusions.

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