DeleteRecord
Remove a specific record from the RushDB database using its unique identifier. Supports optional transaction IDs for atomic deletion operations.
Instructions
Delete a record from the database (alias of DeleteRecordById)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| recordId | Yes | ID of the record to delete | |
| transactionId | No | Optional transaction ID for atomic deletion |
Implementation Reference
- tools/DeleteRecord.ts:17-26 (handler)The core execution logic for the DeleteRecord tool: deletes the specified record using the database client and returns a success confirmation.export async function DeleteRecord(params: { recordId: string; transactionId?: string }) { const { recordId, transactionId } = params await db.records.deleteById(recordId, transactionId) return { success: true, message: `Record '${recordId}' deleted successfully` } }
- tools.ts:106-113 (schema)JSON Schema for input validation: requires recordId string, optional transactionId.inputSchema: { type: 'object', properties: { recordId: { type: 'string', description: 'ID of the record to delete' }, transactionId: { type: 'string', description: 'Optional transaction ID for atomic deletion' } }, required: ['recordId'] }
- tools.ts:103-114 (registration)MCP tool registration: defines name, description, and input schema used for tool listing and validation.{ name: 'DeleteRecord', description: 'Delete a record from the database (alias of DeleteRecordById)', inputSchema: { type: 'object', properties: { recordId: { type: 'string', description: 'ID of the record to delete' }, transactionId: { type: 'string', description: 'Optional transaction ID for atomic deletion' } }, required: ['recordId'] } },
- index.ts:168-180 (registration)Dispatcher in main MCP server: imports and invokes the DeleteRecord handler based on tool name.case 'DeleteRecord': const deleteResult = await DeleteRecord({ recordId: args.recordId as string, transactionId: args.transactionId as string | undefined }) return { content: [ { type: 'text', text: deleteResult.message } ] }
- index.ts:29-29 (registration)Import statement resolving to the DeleteRecord handler implementation.import { DeleteRecord } from './tools/DeleteRecord.js'