add_connection
Save a named PostgreSQL or MySQL connection globally or in the project config, with optional SSH tunnel, SSL settings, and read-only mode for safe agent access.
Instructions
Add a named postgres/mysql connection. scope "global" (default) saves it to the user store; "project" saves it to .dbmole.json in the project root. Supports an optional ssh tunnel and a readonly flag. Optional ssl: true or { rejectUnauthorized, ca } (ca = PEM or file path).
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": {
"name": "<name>",
"host": "<host>",
"user": "<user>",
"type": "<type>"
},
"name": "add_connection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ssh | No | ||
| ssl | No | ||
| host | Yes | ||
| name | Yes | ||
| port | No | ||
| type | Yes | ||
| user | Yes | ||
| scope | No | global | |
| database | No | ||
| password | No | ||
| readonly | No | ||
| queryTimeoutMs | No |