Skip to main content
Glama
sql-lens-mcp

sql-lens-mcp

by varkart

connect_database

Connect to PostgreSQL, MySQL, SQLite, DuckDB, MSSQL, or Oracle so an AI assistant can query it with schema discovery and safety controls.

Instructions

Connect to a database

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": {
      "id": "<id>",
      "type": "<type>"
    },
    "name": "connect_database"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesConnection ID
envNoEnvironment label
sslNoUse SSL
hostNoHostname
nameNoFriendly name
pathNoFile path (SQLite, DuckDB)
portNoPort
typeYesDatabase type
userNoUsername
databaseNoDatabase name
passwordNoPassword
readOnlyNoRead-only mode

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.0

TDQS

D1.9/5.0
Behavior1/5

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

No annotations are provided, so the description carries the full burden and discloses nothing. It does not mention that credentials (user/password) are involved, whether the connection persists after the call or is scoped to the session, whether readOnly mode changes what later queries can do, or what happens on failure or with an existing id.

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

Conciseness3/5

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

The single sentence contains no filler, but conciseness here comes at the cost of under-specification rather than efficiency. There is no structure to speak of and nothing is front-loaded beyond a bare restatement of the name.

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

Completeness1/5

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

This is a 12-parameter tool that handles credentials and establishes persistent state, with no annotations and no output schema. The description says nothing about authentication, connection lifetime, type-dependent required fields (path vs host/port), or security handling of the password field, leaving the agent unequipped to invoke it safely.

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?

Schema description coverage is 100%, so every parameter (id, type, host, port, path, user, password, ssl, readOnly, env, name, database) is already documented in the schema. The description adds no additional meaning about how parameters interact, which are conditionally required by database type, or what the required id means.

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

Purpose2/5

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

"Connect to a database" restates the tool name with a verb and resource but adds no distinguishing detail. It gives no clue how this differs from disconnect_database, list_connections, or view_database_connections, and does not say whether it establishes, tests, or registers a connection.

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?

There is no when-to-use or when-not-to-use guidance, no stated prerequisite (e.g. must be called before execute_query), and no mention of alternatives. An agent must infer entirely from the name that this should precede query execution.

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