create_datasource
Establish a verified database connection and automatically ingest models from schemas so AI agents can query your data without writing SQL.
Instructions
Create a database connection, verify it, and auto-ingest models. Use ${ENV_VAR} syntax in credentials to reference environment variables.
Args: name: Unique datasource name. type: Database type — postgres, mysql, sqlite, bigquery, or snowflake. host: Database host (default: localhost). port: Database port (e.g. 5432 for Postgres). database: Database name. username: Database username. password: Database password. connection_string: Full connection string as alternative to individual fields. schema_name: Default schema name. Also used as the single schema for auto-ingestion. schemas: Comma-separated schemas to ingest. Mutually exclusive with schema_name / all_schemas. all_schemas: Ingest every non-system schema. Mutually exclusive with schema_name / schemas. auto_ingest: Automatically ingest models from the database schema (default: true). Set to false to skip.
Example: create_datasource(name="mydb", type="postgres", host="localhost", port=5432, database="app", username="user", password="pass")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | ||
| name | Yes | ||
| port | No | ||
| type | Yes | ||
| schemas | No | ||
| database | No | ||
| password | No | ||
| username | No | ||
| all_schemas | No | ||
| auto_ingest | No | ||
| schema_name | No | ||
| connection_string | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |