TransactionRollback
Undo database changes by rolling back a transaction in RushDB. Use this tool to revert operations when errors occur or changes need to be canceled.
Instructions
Rollback a database transaction
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| transactionId | Yes | Transaction ID |
Implementation Reference
- tools/TransactionRollback.ts:17-27 (handler)The main handler function that executes the TransactionRollback tool logic by calling db.tx.rollback(transactionId) and returning success message with data.export async function TransactionRollback(params: { transactionId: string }) { const { transactionId } = params const result = await db.tx.rollback(transactionId) return { success: true, message: `Transaction '${transactionId}' rolled back successfully`, data: result.data } }
- tools.ts:440-448 (schema)Input schema definition for the TransactionRollback tool, specifying transactionId as required string.{ name: 'TransactionRollback', description: 'Rollback a database transaction', inputSchema: { type: 'object', properties: { transactionId: { type: 'string', description: 'Transaction ID' } }, required: ['transactionId'] } },
- index.ts:506-517 (registration)Registration in the MCP tool call handler switch statement, dispatching to the TransactionRollback function.case 'TransactionRollback': const rollbackResult = await TransactionRollback({ transactionId: args.transactionId as string }) return { content: [ { type: 'text', text: rollbackResult.message } ] }
- index.ts:50-50 (registration)Import of the TransactionRollback handler function for use in the MCP server.import { TransactionRollback } from './tools/TransactionRollback.js'