TransactionRollback
Undo database changes by rolling back a specific transaction, ensuring data integrity when modifications need to be reversed in the RushDB graph database.
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 core handler function that performs the transaction rollback using the database transaction client db.tx.rollback and returns a success response including the result 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 (registration)Registers the TransactionRollback tool in the tools array exported for MCP ListTools, defining its name, description, and input schema.{ name: 'TransactionRollback', description: 'Rollback a database transaction', inputSchema: { type: 'object', properties: { transactionId: { type: 'string', description: 'Transaction ID' } }, required: ['transactionId'] } },
- tools.ts:443-447 (schema)Input schema definition for the TransactionRollback tool, specifying the required transactionId parameter.inputSchema: { type: 'object', properties: { transactionId: { type: 'string', description: 'Transaction ID' } }, required: ['transactionId'] }
- index.ts:506-517 (helper)Dispatch handler in the MCP server's CallToolRequestSchema that calls the TransactionRollback function with parsed arguments and returns the result message as text content.case 'TransactionRollback': const rollbackResult = await TransactionRollback({ transactionId: args.transactionId as string }) return { content: [ { type: 'text', text: rollbackResult.message } ] }
- index.ts:50-50 (registration)Import statement bringing the TransactionRollback handler into the main index for use in tool dispatching.import { TransactionRollback } from './tools/TransactionRollback.js'