Skip to main content
Glama

BulkDeleteRecords

Delete multiple database records at once using search conditions, labels, or transaction IDs to remove data matching specific criteria.

Instructions

Delete multiple records matching a query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelsNoFilter by record labels
whereYesSearch conditions for records to delete
transactionIdNoOptional transaction ID for atomic bulk deletion

Implementation Reference

  • The core handler function that performs bulk deletion of records matching the provided where clause and optional labels, using the database API.
    export async function BulkDeleteRecords({
      labels,
      where,
      transactionId
    }: BulkDeleteRecordsArgs): Promise<BulkDeleteRecordsResult> {
      const searchQuery: any = { where }
      if (labels && labels.length > 0) {
        searchQuery.labels = labels
      }
    
      const result = await db.records.delete(searchQuery, transactionId)
    
      return {
        message: result.data?.message || 'Records deleted successfully'
      }
    }
  • TypeScript type definitions for the input arguments and output result of the BulkDeleteRecords tool.
    type BulkDeleteRecordsArgs = {
      labels?: string[]
      where: Record<string, any>
      transactionId?: string
    }
    
    type BulkDeleteRecordsResult = {
      message: string
    }
  • tools.ts:270-282 (registration)
    MCP tool registration entry defining the name, description, and input schema for BulkDeleteRecords in the tools list.
    {
      name: 'BulkDeleteRecords',
      description: 'Delete multiple records matching a query',
      inputSchema: {
        type: 'object',
        properties: {
          labels: { type: 'array', items: { type: 'string' }, description: 'Filter by record labels' },
          where: { type: 'object', description: 'Search conditions for records to delete' },
          transactionId: { type: 'string', description: 'Optional transaction ID for atomic bulk deletion' }
        },
        required: ['where']
      }
    },
  • The switch case dispatcher in the main server handler that invokes the BulkDeleteRecords function and formats the MCP response.
    case 'BulkDeleteRecords':
      const bulkDeleteResult = await BulkDeleteRecords({
        labels: args.labels as string[] | undefined,
        where: args.where as Record<string, any>,
        transactionId: args.transactionId as string | undefined
      })
      return {
        content: [
          {
            type: 'text',
            text: bulkDeleteResult.message
          }
        ]
      }
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 of behavioral disclosure. While 'Delete' implies a destructive mutation, it lacks details on permissions, reversibility, side effects, rate limits, or response format. This is inadequate for a bulk deletion tool with no 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 zero wasted words. It is front-loaded with the core action and scope, making it highly concise and well-structured.

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?

Given the tool's complexity (bulk deletion with query filtering), lack of annotations, and no output schema, the description is insufficient. It doesn't address critical aspects like confirmation prompts, error handling, or what happens on success/failure, leaving significant gaps for safe agent 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 fully documents the three parameters. The description adds no additional meaning beyond implying query-based filtering, which is already covered by the 'where' parameter's schema description. Baseline 3 is appropriate as the schema handles parameter documentation.

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 action ('Delete multiple records') and target ('matching a query'), which is specific and unambiguous. However, it doesn't explicitly differentiate from sibling tools like DeleteRecord or DeleteRecordById, which appear to handle single-record deletions.

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?

The description provides no guidance on when to use this tool versus alternatives like DeleteRecord or DeleteRecordById, nor does it mention prerequisites, exclusions, or contextual factors. It merely states what the tool does without usage context.

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