Skip to main content
Glama
fb0sh
by fb0sh

open_connection

Open or reuse a database connection from a DSN and return a connection_id for running queries and commands with other tools.

Instructions

Open (or reuse) a database connection. Returns a connection_id used by the other tools. DSN schemes: postgres://, mysql://, redis://, mongodb://, mongodb+srv://, sqlite:

Input Schema

NameRequiredDescriptionDefault
dsnYesDatabase URL / DSN
nameNoOptional human-friendly label
read_onlyNoRead-only connection (default true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden. It usefully discloses that connections may be reused rather than always created, and enumerates supported DSN schemes, but says nothing about authentication expectations, what happens on an unsupported scheme, connection lifetime/pooling limits, or whether the connection must be explicitly closed via close_connection.

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?

Three short sentences, no filler, with the core action and the return contract front-loaded before the scheme enumeration. Every sentence carries distinct information (action, output, accepted input formats).

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

Completeness4/5

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

For a three-parameter entry-point tool with no output schema and no annotations, the description covers action, return value, and accepted schemes adequately. The remaining gap is lifecycle: it does not state that the connection should be released with close_connection or what happens on connection failure, which matters for a resource-holding tool.

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 schema already documents all three parameters and the baseline is 3. The description earns above baseline by enumerating the concrete accepted DSN schemes (postgres://, mysql://, redis://, mongodb://, mongodb+srv://, sqlite:), which is real added meaning beyond the schema's bare 'Database URL / DSN'.

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+resource ('Open (or reuse) a database connection') and immediately clarifies the return contract ('Returns a connection_id used by the other tools'), which places it as the entry point of the sibling family (close_connection, list_connections, db_query, etc.). An agent can tell what it does and where it sits without opening the schema.

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 implied rather than stated: the 'used by the other tools' clause signals this must be called before db_query/redis_command/mongo_find, but there is no explicit 'call this first' directive and no guidance on when to open a new connection versus reuse an existing one, or when to prefer a fresh connection over list_connections.

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