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.
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 |