DeleteRecordById
Remove a specific record from RushDB using its unique identifier. This tool enables precise data deletion by record ID, with optional transaction support for atomic operations.
Instructions
Delete a record by its ID
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/DeleteRecordById.ts:17-26 (handler)Main handler function that deletes the record by ID using the database utility.export async function DeleteRecordById(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:359-370 (schema)Input schema, description, and registration entry for the DeleteRecordById tool in the tools list.{ name: 'DeleteRecordById', description: 'Delete a record by its ID', 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:396-408 (registration)Dispatcher case in the MCP CallToolRequestSchema handler that invokes the DeleteRecordById function.case 'DeleteRecordById': const deleteByIdResult = await DeleteRecordById({ recordId: args.recordId as string, transactionId: args.transactionId as string | undefined }) return { content: [ { type: 'text', text: deleteByIdResult.message } ] }
- index.ts:72-75 (registration)Registration of the listTools capability that returns the tools array including DeleteRecordById.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }