Register a database datasource
add_datasourceRegisters a relational database from a SQLAlchemy URL, verifies read-only connectivity, and can scan its schema; use it when the user supplies a URL to connect a new data source.
Instructions
Register a relational database by SQLAlchemy URL, verify read-only connectivity, and optionally scan its schema. Use only when the user supplies a URL; never invent credentials, and use scan_datasource instead to re-read an already registered database. Connections are strictly read-only and never modify the target database. Reusing an existing name updates its URL and saved filter while preserving modeled Terms; fails with the connection or driver error if unreachable.
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>",
"url": "<url>"
},
"name": "add_datasource"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | SQLAlchemy URL, e.g. sqlite:////abs/path/file.db, postgresql+psycopg://user:pass@host:5432/db, mysql+pymysql://user:pass@host/db, duckdb:///file.duckdb, oracle+oracledb://user:pass@host:1521/?service_name=ORCLPDB1. | |
| name | Yes | Short datasource identifier without path separators, e.g. 'shop'. | |
| scan | No | Scan the schema and profile columns immediately after connecting. | |
| tables | No | Tables and views to read, for very large schemas: case-insensitive globs such as ['SALES_*', 'HR.EMP*', '!*_LOG'] (* and ? wildcards, % works like *, _ is literal, schema.table when the pattern has a dot, ! excludes). Tables scanned earlier that fall outside the filter are kept, so a catalog can grow area by area. ['*'] reads everything. Default: the datasource's saved filter, else AUTO_ONTOLOGY_SCAN_TABLES, else all tables. Saved with the datasource for later scans. | |
| schemas | No | Schemas to include (default: all non-system schemas). | |
| description | No | Brief business summary of what this database holds. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||