Skip to main content
Glama
cwilby

SQL Server MCP

by cwilby

start-transaction

Initiate a new transaction in Microsoft SQL Server using the MCP server, enabling AI assistants to manage database operations through configurable connections.

Instructions

Start a new transaction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'start-transaction' tool. It generates a random UUID for the transaction ID, starts a database transaction using database.startTransaction(), stores the transaction in the class's transactions Map, and returns a success message with the ID.
    async startTransaction() {
        const transactionId = crypto.randomUUID();
        const transaction = await database.startTransaction();
        this.transactions.set(transactionId, transaction);
    
        return this.toResult(`Transaction started with ID: ${transactionId}.  You can use this ID to commit or rollback the transaction later.`);
    }
  • Registration of the 'start-transaction' tool in the static create method of TransactionTools class, using server.tool() with no input schema (empty args) and binding the startTransaction handler.
    server.tool(
        "start-transaction",
        "Start a new transaction",
        tools.startTransaction.bind(tools)
    );
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. It states the tool starts a transaction but doesn't explain what that entails—e.g., whether it locks resources, requires specific permissions, has side effects, or returns a transaction ID. This is a significant gap for a tool that likely involves state changes.

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 'Start a new transaction' is extremely concise and front-loaded, with no wasted words. It directly states the tool's purpose in a single, clear phrase, making it easy for an agent to parse quickly.

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 transaction management and the lack of annotations or output schema, the description is incomplete. It doesn't explain what a transaction is in this system, how it interacts with siblings like 'commit-transaction', or what the expected behavior or return value is. This leaves critical gaps for proper tool invocation.

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?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate here. A baseline of 4 is applied since there are no parameters to document, and the description doesn't introduce confusion.

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 'Start a new transaction' clearly states the action (start) and resource (transaction), but it's somewhat vague about what a 'transaction' entails in this context and doesn't differentiate from siblings like 'commit-transaction' or 'rollback-transaction'. It's adequate but lacks specificity about the transaction's scope or purpose.

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 like 'commit-transaction' or 'rollback-transaction'. The description implies it initiates a transaction but doesn't specify prerequisites, when it's appropriate, or what operations should follow. This leaves the agent without context for decision-making.

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