ssh_db_query
Run read-only database queries on remote MySQL, PostgreSQL, or MongoDB servers via SSH. Queries are limited to SELECT for SQL and find() for MongoDB, ensuring safe operations.
Instructions
Runs a read-only query against a remote database. For mysql and postgresql it is strictly limited to SELECT: the query must begin with SELECT and any insert, update, delete, drop, create, alter, truncate, grant, revoke, or exec keyword is rejected before execution. For mongodb it runs a find() and requires the collection parameter. Returns the raw command output as text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Database type | |
| query | Yes | SQL query (SELECT only) or MongoDB find query | |
| dbHost | No | Database host (default: localhost) | |
| dbPort | No | Database port | |
| dbUser | No | Database user | |
| server | Yes | Server name | |
| database | Yes | Database name | |
| collection | No | Collection name (MongoDB only) | |
| dbPassword | No | Database password |