Skip to main content
Glama
cwilby
by cwilby

rollback-transaction

Revert a specific transaction in Microsoft SQL Server by specifying its ID using this tool, ensuring database integrity and resolving unintended changes.

Instructions

Rollback a transaction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
transactionIdYesThe ID of the transaction to rollback.

Implementation Reference

  • Handler function that retrieves the transaction from the map, calls rollback on it, deletes from map, and returns success message.
    async rollbackTransaction({ transactionId }: { transactionId: string }) { const transaction = this.transactions.get(transactionId); if (!transaction) { throw new Error(`Transaction with ID ${transactionId} not found.`); } await transaction.rollback(); this.transactions.delete(transactionId); return this.toResult(`Transaction with ID ${transactionId} rolled back successfully.`); }
  • Registers the rollback-transaction tool with the MCP server, including description, input schema, and handler binding.
    server.tool( "rollback-transaction", "Rollback a transaction", { transactionId: z.string().describe("The ID of the transaction to rollback.") }, tools.rollbackTransaction.bind(tools), );
  • Zod schema defining the input parameter transactionId as a string.
    { transactionId: z.string().describe("The ID of the transaction to rollback.") },

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cwilby/mcp-node-mssql'

If you have feedback or need assistance with the MCP directory API, please join our Discord server