Skip to main content
Glama
cwilby

SQL Server MCP

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);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. 'Commit a transaction' implies a write operation that finalizes changes, but it does not specify effects (e.g., data persistence, atomicity), permissions required, error conditions, or side effects. This is a significant gap for a mutation tool with zero annotation coverage.

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

Conciseness4/5

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

The description is a single, efficient sentence with no wasted words, making it appropriately concise. However, it is not front-loaded with critical details (e.g., behavioral traits), which slightly reduces its effectiveness despite the brevity.

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 the complexity of a transaction commit (a mutation with potential side effects), no annotations, and no output schema, the description is incomplete. It fails to explain return values, error handling, or interactions with sibling tools, leaving the agent under-informed for safe and correct usage.

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

Parameters3/5

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

The input schema has 100% description coverage, with the 'transactionId' parameter clearly documented. The description does not add any meaning beyond the schema (e.g., format examples or constraints), so it meets the baseline of 3 where the schema does the heavy lifting.

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 'Commit a transaction' states the action (commit) and resource (transaction), which provides a basic understanding of the tool's purpose. However, it lacks specificity about what committing entails (e.g., finalizing database changes) and does not differentiate it from sibling tools like 'rollback-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?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., needing an active transaction from 'start-transaction'), exclusions, or comparisons to siblings like 'rollback-transaction' for undoing changes, leaving the agent without usage context.

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