Overview
List all databases available in the connection with their names and types. This tool is particularly useful when multiple DuckDB databases are attached or when connected to MotherDuck. For MotherDuck connections, it uses theMD_ALL_DATABASES() function to list all databases. For local DuckDB connections, it uses the duckdb_databases() system function.
Internal databases (system and temp) are automatically excluded from the results.
Parameters
This tool does not require any input parameters.Response
Indicates whether the operation completed successfully.
Array of database objects. Each object contains:
name(string): Database name or aliastype(string): Database type (e.g., “motherduck”, “duckdb”, “sqlite”)
Total number of databases returned (excludes system and temp databases).
Error message when success is false.
Type of error that occurred.
Examples
MotherDuck Connection with Multiple Databases
Response:Local DuckDB with Single Database
Response:Local DuckDB with Attached Databases
Response:In-Memory Database
Response:Error Response
Response:Use Cases
When to Use list_databases
- MotherDuck Connections: Discover all available databases in your MotherDuck account
- Multi-Database Setups: Understand which databases are attached in a local DuckDB session
- Database Discovery: Before querying data, verify which databases are accessible
- Context Building: Help AI assistants understand the database environment before executing queries
When NOT to Use list_databases
- Single Local Database: For simple single-file DuckDB connections, you typically know the database name already
- In-Memory Only: If working exclusively with
:memory:, listing databases is usually unnecessary
Tool Annotations
This tool is always read-only with
readOnlyHint: true and destructiveHint: false, regardless of server mode.Related Tools
- Use list_tables to see tables within a specific database
- Use list_columns to see columns within a specific table
- Use execute_query to query data from discovered databases