Skip to main content
Glama
cwilby

SQL Server MCP

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.") },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but only states the action without behavioral details. It doesn't disclose effects (e.g., data changes undone, transaction closure), permissions needed, error conditions, or side effects, which is inadequate for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with no wasted words, making it highly concise and front-loaded. It efficiently communicates the core action without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavior, effects, or return values, failing to compensate for the missing structured data, which is insufficient for safe use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with one parameter ('transactionId') well-documented in the schema. The description adds no parameter details beyond the schema, but with high coverage and zero parameters needing compensation, the baseline is 4 as it doesn't detract from understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Rollback a transaction' states the action (rollback) and resource (transaction), providing a basic purpose. However, it lacks specificity about what rolling back entails (e.g., undoing changes, reverting state) and doesn't distinguish from siblings like 'commit-transaction' or 'start-transaction', making it vague in context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an active transaction), exclusions, or how it relates to siblings like 'commit-transaction' or 'start-transaction', leaving usage unclear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install 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