list-tables
Retrieve a comprehensive list of all DynamoDB tables directly from the DynamoDB Read-Only MCP server to manage and analyze your database structure efficiently.
Instructions
Get a list of all DynamoDB tables
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:22-45 (registration)Registration of the 'list-tables' tool, including inline handler that invokes listTables helper, formats the response as text content, and handles errors.server.tool('list-tables', 'Get a list of all DynamoDB tables', {}, async () => { try { console.error('# list-tables tool has been called'); const tables = await listTables(); return { content: [ { type: 'text', text: JSON.stringify(tables, null, 2), }, ], }; } catch (error: any) { return { isError: true, content: [ { type: 'text', text: `Error occurred: ${error.message}`, }, ], }; } });
- src/dynamo-helpers.ts:7-19 (handler)Core handler logic for listing DynamoDB tables using ListTablesCommand on the DynamoDB client.export async function listTables() { console.error('# Starting listTables function'); try { const command = new ListTablesCommand({}); console.error('# ListTables command created successfully'); const response = await dynamodb.send(command); console.error('# ListTables response received:', response); return response.TableNames || []; } catch (error) { console.error('# Error in listTables function:', error); throw error; } }