Skip to main content
Glama

connect_database

Connect to a SQLite or PostgreSQL database using a connection URI or file path to start exploring and querying data.

Instructions

Connect to a SQLite or PostgreSQL database. For SQLite, connection_string can be a file path (e.g. 'dev.db') or ':memory:'. For Postgres, connection_string must be a valid PostgreSQL connection URI. Resolves relative paths for SQLite databases against the current working directory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
db_typeYesThe type of database engine.
connection_stringYesConnection URI or file path to connect to.
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses path resolution behavior for SQLite but omits other behaviors such as authentication requirements, error handling, connection lifetime, or side effects (e.g., whether it sets a global state). This leaves moderate gaps for a connection tool.

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 is concise (two sentences), front-loaded with the main purpose, and every sentence adds necessary detail without extraneous content.

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 tool with only two parameters and no output schema, the description covers key aspects: supported db types, connection string formats, and path resolution. However, it could be more complete by describing the outcome of a connection (e.g., returns a connection ID or sets a global state) or mentioning that subsequent tools require this connection.

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% but the description adds substantial value: it specifies that connection_string content depends on db_type (file path vs URI) and mentions relative path resolution. It goes beyond the schema's generic descriptions.

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?

The description explicitly states the main action: 'Connect to a SQLite or PostgreSQL database.' The resource (database) and the two supported engines are clearly identified, distinguishing it from sibling tools like list_tables or run_query.

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

Usage Guidelines4/5

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

The description provides clear usage context: for SQLite, connection_string can be a file path or ':memory:'; for Postgres, it must be a valid URI. It does not explicitly state when not to use it or mention alternatives, but the sibling tools are oriented toward post-connection operations, implying this is a prerequisite.

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

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/arman1o1/mcp-db-explorer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server