Skip to main content
Glama
DataPilot MCP

DataPilot MCP

Connect database

connect_database
Destructive

Open a SQLite file or PostgreSQL database for a new or replacement connection, then discover its schema; reusing an alias replaces that connection.

Instructions

Open a SQLite file or PostgreSQL database, then discover its schema. Use only for a new or replacement connection. An existing alias is replaced. SQLite paths are resolved on the server host. For PostgreSQL use a dedicated read-only role and pass the password's environment variable name, never its value. Non-local hosts require operator opt-in. Returns connection details, database version, whether a test write was refused, schema and generated-tool counts. The write probe is a diagnostic. Use list_connections to find existing aliases.

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

Input Schema

NameRequiredDescriptionDefault
hostNoPostgreSQL hostname. Defaults to localhost.
portNoPostgreSQL port. Defaults to 5432.
aliasNoConnection name. Reusing it replaces that connection.main
backendNo'sqlite' or 'postgresql'sqlite
sslmodeNoPostgreSQL TLS mode, e.g. verify-full. Optional.
databaseYesSQLite file on the server host, or PostgreSQL database name.
usernameNoPostgreSQL role name. Use a dedicated read-only role.
password_envNoServer environment variable name holding the PostgreSQL password.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.2.0
    • changedInput schema / properties / alias / description
      Previous value: -"Short name for this connection"New value: +"Connection name. Reusing it replaces that connection."
    • changedInput schema / properties / database / description
      Previous value: -"SQLite file path, or PostgreSQL database name"New value: +"SQLite file on the server host, or PostgreSQL database name."
    • changedInput schema / properties / host / description
      Previous value: -"PostgreSQL host"New value: +"PostgreSQL hostname. Defaults to localhost."
    • changedInput schema / properties / password_env / description
      Previous value: -"Name of the env var holding the password"New value: +"Server environment variable name holding the PostgreSQL password."
    • changedInput schema / properties / port / description
      Previous value: -"PostgreSQL port"New value: +"PostgreSQL port. Defaults to 5432."
    • changedInput schema / properties / sslmode / description
      Previous value: -"PostgreSQL sslmode"New value: +"PostgreSQL TLS mode, e.g. verify-full. Optional."
    • changedInput schema / properties / username / description
      Previous value: -"PostgreSQL user"New value: +"PostgreSQL role name. Use a dedicated read-only role."
  2. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

The annotations declare a destructive, open-world write, and the description corroborates rather than repeats them: an existing alias is replaced, SQLite paths resolve on the server host, non-local hosts need operator opt-in, and a write probe is run and may be refused. That is genuinely non-obvious behavior (security posture, host allowlisting, side-effecting replacement) an agent could not infer from structured fields.

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?

Dense and front-loaded — the action and its usage bound come first, security constraints follow. The one soft spot is the return-value sentence (connection details, version, write-probe result, schema/tool counts), which is largely duplicated by the existing output schema and could be trimmed.

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

Completeness5/5

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

For an 8-parameter, destructive, open-world connection tool with an output schema, the description covers everything the output schema cannot: replacement semantics, credential-handling rules, host-allowlist gating, and the fact that a write probe is diagnostic. Nothing an agent needs in order to call it safely is missing.

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%, so the baseline is 3, but the description adds real semantics on top: password_env must be the variable name and never the value, and database paths are interpreted on the server host rather than the client. Alias replacement is also restated as a parameter consequence, though that is already stated in the schema.

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

Purpose5/5

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

States a specific verb and resource — open a SQLite file or PostgreSQL database and discover its schema — plus scope qualifiers (new or replacement connection only). It also names the sibling tool (list_connections) for the adjacent use case, so the agent can distinguish it without opening schemas.

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

Usage Guidelines5/5

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

Explicitly bounds usage: 'Use only for a new or replacement connection' and routes the agent to list_connections to find existing aliases. It also documents preconditions a caller would otherwise discover by failing — operator opt-in for non-local hosts and a dedicated read-only PostgreSQL role.

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