Skip to main content
Glama
imankamyabi

DynamoDB MCP Server

by imankamyabi

list_tables

Retrieve a list of DynamoDB tables in your account, with options for pagination and limiting results, using the DynamoDB MCP Server.

Instructions

Lists all DynamoDB tables in the account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exclusiveStartTableNameNoName of the table to start from for pagination (optional)
limitNoMaximum number of tables to return (optional)

Implementation Reference

  • The handler function for the list_tables tool. It creates a ListTablesCommand with optional limit and pagination token, sends it to the DynamoDB client, and returns the table names or error.
    async function listTables(params: any) { try { const command = new ListTablesCommand({ Limit: params.limit, ExclusiveStartTableName: params.exclusiveStartTableName, }); const response = await dynamoClient.send(command); return { success: true, message: "Tables listed successfully", tables: response.TableNames, lastEvaluatedTable: response.LastEvaluatedTableName, }; } catch (error) { console.error("Error listing tables:", error); return { success: false, message: `Failed to list tables: ${error}`, }; }
  • The Tool object definition for list_tables, including name, description, and inputSchema for validation.
    const LIST_TABLES_TOOL: Tool = { name: "list_tables", description: "Lists all DynamoDB tables in the account", inputSchema: { type: "object", properties: { limit: { type: "number", description: "Maximum number of tables to return (optional)" }, exclusiveStartTableName: { type: "string", description: "Name of the table to start from for pagination (optional)" }, }, }, };
  • src/index.ts:598-600 (registration)
    Registration of the list_tables tool in the ListToolsRequestHandler by including LIST_TABLES_TOOL in the returned tools array.
    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:611-613 (registration)
    Dispatch/execution registration in the CallToolRequestHandler switch statement, calling the listTables handler.
    case "list_tables": result = await listTables(args); break;

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