register_instance
Register a MySQL-compatible database connection at runtime, testing connectivity before caching and replacing any existing connection with the same name.
Instructions
Register a MySQL-compatible database connection at runtime.
Tests the connection with SELECT 1 before caching. If a connection with the same name already exists, it is closed and replaced.
Args: name: A human-readable identifier for this instance (used as instance_id). host: Database host or IP address. port: Database port (e.g. 3306). user: Database username. password: Database password. database: Optional default database/schema. charset: Connection charset, defaults to utf8mb4.
Returns: JSON string with instance_id and status, or error details.
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>",
"port": "<port>",
"user": "<user>",
"password": "<password>"
},
"name": "register_instance"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | ||
| name | Yes | ||
| port | Yes | ||
| user | Yes | ||
| charset | No | utf8mb4 | |
| database | No | ||
| password | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |