Skip to main content
Glama
jjikky

DynamoDB Read-Only MCP

by jjikky

get-item

Retrieve a specific item from a DynamoDB table using a defined key in JSON format. Simplify querying and access data directly from AWS DynamoDB databases.

Instructions

Get an item from a DynamoDB table based on a specific key

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesItem key (JSON format)
tableNameYesTable name

Implementation Reference

  • Core implementation of the get-item tool logic using AWS SDK's GetItemCommand to retrieve a single item from DynamoDB.
    export async function getItem(tableName: string, key: Record<string, any>) {
      console.error('# Starting getItem function:', { tableName, key });
      try {
        const command = new GetItemCommand({
          TableName: tableName,
          Key: key,
        });
        console.error('# GetItem command created successfully');
        const response = await dynamodb.send(command);
        console.error('# GetItem response received:', response);
        return response.Item;
      } catch (error) {
        console.error('# Error in getItem function:', error);
        throw error;
      }
    }
  • Zod input schema defining parameters for the get-item tool: tableName and key.
    {
      tableName: z.string().describe('Table name'),
      key: z.record(z.any()).describe('Item key (JSON format)'),
    },
  • src/index.ts:252-292 (registration)
    MCP server tool registration for 'get-item', including description, schema, and handler wrapper that calls the core getItem function.
    server.tool(
      'get-item',
      'Get an item from a DynamoDB table based on a specific key',
      {
        tableName: z.string().describe('Table name'),
        key: z.record(z.any()).describe('Item key (JSON format)'),
      },
      async ({ tableName, key }) => {
        try {
          const item = await getItem(tableName, key);
          if (!item) {
            return {
              content: [
                {
                  type: 'text',
                  text: 'Could not find the corresponding item.',
                },
              ],
            };
          }
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(item, null, 2),
              },
            ],
          };
        } catch (error: any) {
          return {
            isError: true,
            content: [
              {
                type: 'text',
                text: `Error occurred: ${error.message}`,
              },
            ],
          };
        }
      }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It states the action but doesn't disclose permissions needed, error conditions, rate limits, or what happens if the key doesn't exist. For a database read operation, this leaves significant gaps in understanding its behavior.

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 with zero wasted words. It's appropriately sized and front-loaded with the core purpose, making it easy to parse quickly.

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 database read tool with no annotations and no output schema, the description is insufficient. It doesn't explain return values, error handling, or operational constraints. Given the complexity of DynamoDB operations and lack of structured metadata, more context is needed for effective use.

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?

Schema description coverage is 100%, so the schema already documents both parameters fully. The description adds no additional meaning about parameter usage, constraints, or examples beyond what's in the schema. Baseline 3 is appropriate when the schema does all the work.

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 verb ('Get') and resource ('an item from a DynamoDB table') with the specific mechanism ('based on a specific key'). It distinguishes from siblings like 'scan-table' or 'query-table' by emphasizing key-based retrieval, but doesn't explicitly contrast with all alternatives like 'paginate-query-table'.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, when-not scenarios, or compare with sibling tools like 'query-table' for more complex retrievals or 'scan-table' for full table scans.

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/jjikky/dynamo-readonly-mcp'

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