Skip to main content
Glama
cwilby
by cwilby

commit-transaction

Commit a specified transaction in Microsoft SQL Server databases using the transaction ID for secure and controlled database operations.

Instructions

Commit a transaction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
transactionIdYesThe ID of the transaction to commit.

Implementation Reference

  • The main handler function for the 'commit-transaction' tool. It retrieves the transaction from the local map, commits it using the database transaction object, removes it from the map, and returns a success message.
    async commitTransaction({ transactionId }: { transactionId: string }) { const transaction = this.transactions.get(transactionId); if (!transaction) { throw new Error(`Transaction with ID ${transactionId} not found.`); } await transaction.commit(); this.transactions.delete(transactionId); return this.toResult(`Transaction with ID ${transactionId} committed successfully.`);
  • Zod schema defining the input parameter 'transactionId' as a string for the 'commit-transaction' tool.
    { transactionId: z.string().describe("The ID of the transaction to commit.") },
  • Registers the 'commit-transaction' tool on the MCP server, specifying name, description, schema, and handler.
    server.tool( "commit-transaction", "Commit a transaction", { transactionId: z.string().describe("The ID of the transaction to commit.") }, tools.commitTransaction.bind(tools), );
  • src/server.ts:19-19 (registration)
    Top-level call to create and register TransactionTools, which includes the 'commit-transaction' tool.
    TransactionTools.create(server);

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