Skip to main content
Glama
sql-mcp
by ohankay

add_connection

Register or replace a SQL Server connection profile at runtime and test it, so new databases can be queried without restarting the server.

Instructions

Register (or replace) a connection profile at runtime and test it.

auth: 'windows' = the current Windows logon (integrated/trusted), 'sql' = SQL login (user + password). Prefer password_env (name of an environment variable) over passing a password in chat. server: 'host', 'host\INSTANCE' or 'host,port'.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>",
      "server": "<server>"
    },
    "name": "add_connection"
  }
}

Input Schema

NameRequiredDescriptionDefault
authNowindows
nameYes
portNo
userNo
driverNoauto
serverYes
encryptNoyes
databaseNomaster
max_rowsNo
passwordNo
readonlyNo
make_defaultNo
password_envNo
query_timeoutNo
trust_server_certificateNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false, and destructiveHint=false, so the safety bar is pre-set. The description usefully adds that this replaces an existing profile of the same name and that it tests the connection immediately, which is real behavioral context. It stops short of saying what happens if the test fails (is the profile still saved?), whether credentials persist, or what the response looks like — meaningful gaps for a mutating tool.

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?

Front-loaded purpose sentence followed by terse, high-value notes on auth, credentials, and server syntax. No filler, though the terse line-per-field format leaves the undocumented parameters conspicuously absent rather than deliberately omitted.

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?

A 15-parameter mutation tool with zero schema description coverage and no output schema needs far more from the description than three short notes. Critical items for correct invocation — whether a failed test still registers the profile, how readonly/make_default behave, and what driver "auto" resolves to — are entirely unaddressed.

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

Parameters2/5

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

With 0% schema description coverage across 15 parameters, the description carries the full burden, and it explains only a handful: auth modes, the password_env-over-password preference, and server string format (host / host\INSTANCE / host,port). Ten parameters — name, database, driver, port, encrypt, max_rows, readonly, make_default, query_timeout, trust_server_certificate — get no explanation anywhere, leaving the agent to guess at defaults semantics and security implications.

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

Purpose4/5

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

The description opens with a specific verb and resource: "Register (or replace) a connection profile at runtime and test it." That is unambiguous about what the tool does and adds the replace/test nuance beyond the bare name. It does not, however, name or distinguish itself from the sibling test_connection, which covers overlapping ground.

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

Usage Guidelines3/5

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

Usage is only implied — "at runtime" and "or replace" hint at when you'd call this, and the auth/password_env guidance tells the agent how to call it safely. There is no explicit statement of when to use this versus test_connection or list_connections, nor any prerequisites or exclusions.

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