Skip to main content
Glama
MCP Database Server

MCP Database Server

by RifkyR3

db_register_main_connection

Add or update a main PostgreSQL/MySQL connection configuration at runtime to enable dynamic query routing, database discovery, and schema inspection.

Instructions

Dynamically add or update a main database connection configuration at runtime

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>",
      "engine": "<engine>",
      "host": "<host>",
      "user": "<user>"
    },
    "name": "db_register_main_connection"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesUnique ID for this main connection (e.g. "local_pg" or "office_mysql")
hostYesHost address or IP
portNoPort number (default 5432 for postgres, 3306 for mysql)
userYesUsername
engineYesEngine type: "postgres" or "mysql"
passwordNoPassword
descriptionNoOptional description
persistToFileNoWhether to save this configuration to connections.json (default true)
defaultDatabaseNoDefault/admin database name

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.2

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full burden and falls well short. It does not disclose that the call may overwrite an existing connection with the same id, that it can write credentials to connections.json when persistToFile is true, whether the connection is validated before being stored, or how credentials are handled.

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?

A single front-loaded sentence with no filler, and the add-or-update semantics are stated up front. It is efficient, though the brevity comes at the cost of the behavioral detail noted elsewhere.

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?

This is a nine-parameter mutation tool with no annotations and no output schema, so the description must cover side effects and it does not. An agent cannot learn from it whether an existing connection is replaced, whether persistence to disk happens by default, or what a successful registration returns.

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% and every one of the nine parameters, including the engine enum and the port defaults, is documented in the schema itself. The description adds no meaning beyond that, so the baseline of 3 applies.

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 names a specific verb pair ("add or update") and resource ("main database connection configuration"), and the qualifier "main" implicitly distinguishes it from the sibling db_register_sub_connection. It stops short of explicitly stating that contrast, but an agent can still tell what the tool creates.

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?

"Dynamically add or update ... at runtime" implies the usage context (programmatic registration of a connection), but there is no explicit when-to-use guidance against db_register_sub_connection, db_test_connection, or db_list_connections, and no stated prerequisites such as validating the connection first.

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