Skip to main content
Glama
imankamyabi

DynamoDB MCP Server

by imankamyabi

update_gsi

Update the read and write capacity units of a DynamoDB global secondary index by specifying the table name, index name, and desired provisioned throughput.

Instructions

Updates the provisioned capacity of a global secondary index

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexNameYesName of the index to update
readCapacityYesNew read capacity units
tableNameYesName of the table
writeCapacityYesNew write capacity units

Implementation Reference

  • The main handler function that implements the update_gsi tool logic by sending an UpdateTableCommand to update the provisioned throughput of a Global Secondary Index (GSI).
    async function updateGSI(params: any) {
      try {
        const command = new UpdateTableCommand({
          TableName: params.tableName,
          GlobalSecondaryIndexUpdates: [
            {
              Update: {
                IndexName: params.indexName,
                ProvisionedThroughput: {
                  ReadCapacityUnits: params.readCapacity,
                  WriteCapacityUnits: params.writeCapacity,
                },
              },
            },
          ],
        });
        
        const response = await dynamoClient.send(command);
        return {
          success: true,
          message: `GSI ${params.indexName} capacity updated on table ${params.tableName}`,
          details: response.TableDescription,
        };
      } catch (error) {
        console.error("Error updating GSI:", error);
        return {
          success: false,
          message: `Failed to update GSI: ${error}`,
        };
      }
    }
  • The Tool object definition for 'update_gsi', including the input schema for validation.
    const UPDATE_GSI_TOOL: Tool = {
      name: "update_gsi",
      description: "Updates the provisioned capacity of a global secondary index",
      inputSchema: {
        type: "object",
        properties: {
          tableName: { type: "string", description: "Name of the table" },
          indexName: { type: "string", description: "Name of the index to update" },
          readCapacity: { type: "number", description: "New read capacity units" },
          writeCapacity: { type: "number", description: "New write capacity units" },
        },
        required: ["tableName", "indexName", "readCapacity", "writeCapacity"],
      },
    };
  • src/index.ts:598-600 (registration)
    Registration of the update_gsi tool (as UPDATE_GSI_TOOL) in the list of available tools returned by ListToolsRequest.
    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:617-619 (registration)
    Switch case in the CallToolRequest handler that dispatches 'update_gsi' calls to the updateGSI function.
    case "update_gsi":
      result = await updateGSI(args);
      break;
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is an update operation but doesn't mention whether this requires specific permissions, whether it's a destructive change, what happens to existing capacity settings, rate limits, or what the response looks like. For a capacity management tool with zero annotation coverage, this leaves significant behavioral gaps.

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 gets straight to the point with zero wasted words. It's appropriately sized for what it communicates and is perfectly front-loaded with the essential information.

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 capacity update tool with no annotations and no output schema, the description is insufficient. It doesn't explain what 'provisioned capacity' means in practical terms, what units are used, whether changes are immediate or gradual, what validation occurs, or what happens on failure. The context signals show this is a 4-parameter mutation tool that needs more behavioral context.

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 all parameters are documented in the input schema. The description doesn't add any additional parameter context beyond what's already in the schema properties. It mentions 'provisioned capacity' which aligns with the readCapacity and writeCapacity parameters, but provides no extra semantic value.

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 ('Updates') and the resource ('provisioned capacity of a global secondary index'), making the purpose immediately understandable. It doesn't explicitly differentiate from siblings like 'update_capacity' or 'update_item', but the specificity of 'global secondary index' provides some implicit distinction.

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 'update_capacity' or 'create_gsi'. It doesn't mention prerequisites, dependencies, or scenarios where this operation is appropriate versus other update operations.

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