Skip to main content
Glama

BulkCreateRecords

Create multiple database records simultaneously in RushDB to streamline data insertion and improve efficiency for batch operations.

Instructions

Create multiple records in a single operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelYesLabel for all records
dataYesArray of record data to insert
transactionIdNoOptional transaction ID for atomic bulk creation

Implementation Reference

  • The main handler function implementing the BulkCreateRecords tool logic: creates multiple records using db.records.createMany within an optional transaction and returns success message with generated IDs.
    export async function BulkCreateRecords({
      label,
      data,
      transactionId
    }: BulkCreateRecordsArgs): Promise<BulkCreateRecordsResult> {
      const result = await db.records.createMany({ label, data }, transactionId)
      const ids = result.data.map((record: any) => record.id())
    
      return {
        message: `Successfully created ${ids.length} records with label '${label}'`,
        ids
      }
    }
  • TypeScript type definitions for input arguments (BulkCreateRecordsArgs) and output result (BulkCreateRecordsResult) used by the handler.
    type BulkCreateRecordsArgs = {
      label: string
      data: Record<string, any>[]
      transactionId?: string
    }
    
    type BulkCreateRecordsResult = {
      message: string
      ids: string[]
    }
  • tools.ts:257-269 (registration)
    Tool registration entry in the tools array, providing the name, description, and JSON schema for input validation in the MCP server.
    {
      name: 'BulkCreateRecords',
      description: 'Create multiple records in a single operation',
      inputSchema: {
        type: 'object',
        properties: {
          label: { type: 'string', description: 'Label for all records' },
          data: { type: 'array', items: { type: 'object' }, description: 'Array of record data to insert' },
          transactionId: { type: 'string', description: 'Optional transaction ID for atomic bulk creation' }
        },
        required: ['label', 'data']
      }
    },
  • Dispatcher switch case that invokes the BulkCreateRecords handler with parsed arguments and formats the MCP response content.
    case 'BulkCreateRecords':
      const bulkCreateResult = await BulkCreateRecords({
        label: args.label as string,
        data: args.data as Record<string, any>[],
        transactionId: args.transactionId as string | undefined
      })
      return {
        content: [
          {
            type: 'text',
            text: `${bulkCreateResult.message}\nIDs: ${bulkCreateResult.ids.join(', ')}`
          }
        ]
      }
  • tools.ts:28-28 (registration)
    Includes 'BulkCreateRecords' in the ToolName type union for type safety.
    | 'BulkCreateRecords'
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the action ('Create multiple records') but lacks details on permissions, atomicity (implied by 'single operation' but not clarified), error handling, or response format. This is inadequate for a mutation tool with zero annotation coverage.

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 no wasted words. It is front-loaded and directly conveys the core functionality without unnecessary elaboration.

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 mutation tool with no annotations and no output schema, the description is insufficient. It lacks details on behavioral traits (e.g., atomicity, error handling), usage context, and return values, leaving significant gaps for an AI agent to understand and invoke it correctly.

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 fully documents the three parameters. The description adds no additional meaning beyond implying bulk creation, which is already clear from the tool name and schema. Baseline 3 is appropriate as the schema does the heavy lifting.

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 ('Create') and resource ('multiple records'), and specifies the scope ('in a single operation'). It distinguishes from the sibling 'CreateRecord' by emphasizing bulk creation, though it doesn't explicitly contrast with other bulk operations like 'BulkDeleteRecords'.

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 like 'CreateRecord' for single records or 'BulkDeleteRecords' for deletions. The description implies bulk scenarios but lacks explicit context, prerequisites, or exclusions.

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

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/rush-db/RushDB'

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