DeleteRecord
Remove specific records from RushDB database by ID, supporting optional transaction-based atomic deletions for data integrity.
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 handler function for the DeleteRecord tool that performs the database deletion operation.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:104-114 (schema)JSON schema defining the input parameters for the DeleteRecord tool, used in MCP tool listing.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)Dispatching logic in the MCP CallToolRequest handler that routes DeleteRecord tool calls to the imported handler function.case 'DeleteRecord': const deleteResult = await DeleteRecord({ recordId: args.recordId as string, transactionId: args.transactionId as string | undefined }) return { content: [ { type: 'text', text: deleteResult.message } ] }