Skip to content

SQL Database ​

Run safe SQL queries, inspect tables, and read schemas.

FamilyCategorySub-typeAuth type
Developer Platformdatabasesqlconnection_string

Overview ​

Product URLAPI docsSupported features
https://www.postgresql.org/https://www.postgresql.org/docs/tool_discovery, health_check

Setup ​

  1. Install the connector instance.
  2. Store the provider token or connection secret.
  3. Sync the tools and test the connection.
  4. Review approval-gated write tools before running them.

Auth & Configuration ​

FieldRequiredTypeNotes
dialectYespostgresql or mysql
sslNoboolean
statementTimeoutMsNointeger
maxRowsNointeger

Available Tools ​

ToolRequires approvalDescription
queryNoExecute a parameterized SQL query against the database. Returns up to 1000 rows.
list_tablesNoList all user-created tables in the database with their schemas.
describe_tableNoGet column names, types, and constraints for a table.

Use query for the main execution example below because it is safe to run without approval.

Examples ​

Install ​

curl -X POST "https://api.chainabit.com/api/v1/connectors/instances" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "connectorKey": "sql-database",
  "displayName": "SQL Database"
}'

Credentials ​

curl -X POST "https://api.chainabit.com/api/v1/connectors/instances/$INSTANCE_ID/credentials" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "credType": "connection_string",
  "credentials": {
    "connectionString": "postgresql://user:password@host:5432/database?sslmode=require"
  }
}'

Execute ​

curl -X POST "https://api.chainabit.com/api/v1/connectors/instances/$INSTANCE_ID/tools/tool_query/execute" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {}
}'

Security Notes ​

  • Keep tokens, API keys, and connection strings in the encrypted credentials vault.
  • Do not allow arbitrary server URLs for remote MCP connectors.

Troubleshooting ​

  • If the health check fails, verify the token scope or credential payload and try again.
  • If the tool list is empty, re-run sync-tools after storing the latest credentials.

Back to the catalog

Built with purpose. chainabit.com