Skip to main content
Glama

BulkDeleteRecords

Remove multiple database records that match specific search conditions in RushDB. Use this tool to clean up data by deleting records based on defined criteria and optional labels.

Instructions

Delete multiple records matching a query

Input Schema

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

Implementation Reference

  • The primary handler function implementing the BulkDeleteRecords tool. It constructs a search query from the input arguments and calls the database client's delete method to remove matching records, optionally within a transaction. Returns a success message.
    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 handler, providing structure validation.
    type BulkDeleteRecordsArgs = { labels?: string[] where: Record<string, any> transactionId?: string } type BulkDeleteRecordsResult = { message: string }
  • tools.ts:270-282 (registration)
    MCP tool registration entry in the tools list, including name, description, and JSON input schema for validation by the MCP server.
    { 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'] } },
  • Dispatch logic in the MCP CallToolRequest handler that invokes the BulkDeleteRecords tool function with parsed arguments and formats the response for MCP protocol.
    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 } ] }

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/1pxone/RushDB'

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