Skip to main content
Glama
jjikky

DynamoDB Read-Only MCP

by jjikky

describe-table

Retrieve comprehensive details about a DynamoDB table, including schema and configuration, by specifying its name using this tool on the DynamoDB Read-Only MCP server.

Instructions

Get detailed information about a DynamoDB table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableNameYesName of the table to get details for

Implementation Reference

  • src/index.ts:47-76 (registration)
    MCP server.tool registration for 'describe-table', defining name, description, input schema, and thin async handler that calls describeTable and formats response.
    server.tool(
      'describe-table',
      'Get detailed information about a DynamoDB table',
      {
        tableName: z.string().describe('Name of the table to get details for'),
      },
      async ({ tableName }) => {
        try {
          const tableInfo = await describeTable(tableName);
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(tableInfo, null, 2),
              },
            ],
          };
        } catch (error: any) {
          return {
            isError: true,
            content: [
              {
                type: 'text',
                text: `Error occurred: ${error.message}`,
              },
            ],
          };
        }
      }
    );
  • Core handler logic: creates DescribeTableCommand with tableName and sends it to DynamoDB client, returning the Table description or throwing error.
    export async function describeTable(tableName: string) {
      console.error('# Starting describeTable function:', tableName);
      try {
        const command = new DescribeTableCommand({
          TableName: tableName,
        });
        console.error('# DescribeTable command created successfully');
        const response = await dynamodb.send(command);
        console.error('# DescribeTable response received:', response);
        return response.Table;
      } catch (error) {
        console.error('# Error in describeTable function:', error);
        throw error;
      }
    }
  • Zod input schema defining 'tableName' as required string parameter.
    {
      tableName: z.string().describe('Name of the table to get details for'),
    },
  • Helper function to initialize and provide the DynamoDBDocumentClient instance used by describeTable.
    export const getDynamodb = (): DynamoDBDocumentClient => {
      if (!dynamoDbDocClient) {
        dynamoDbClient = new DynamoDBClient({
          region: process.env.AWS_REGION || 'ap-northeast-2',
          credentials: {
            accessKeyId: process.env.AWS_ACCESS_KEY_ID || '',
            secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY || '',
            sessionToken: process.env.AWS_SESSION_TOKEN || undefined, // Optional, only if using temporary credentials
          },
        });
        dynamoDbDocClient = DynamoDBDocumentClient.from(dynamoDbClient);
      }
      return dynamoDbDocClient;
    };
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