Skip to main content
Glama
jjikky

DynamoDB Read-Only MCP

by jjikky

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
NameRequiredDescriptionDefault

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}`,
            },
          ],
        };
      }
    });
  • 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;
      }
    }
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/jjikky/dynamo-readonly-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server