Overview
List all columns of a table or view with their data types, nullability, and comments. If database or schema parameters are not specified, the tool uses the current database and schema. This tool queries DuckDB’sduckdb_columns() system function to retrieve column metadata and automatically determines whether the object is a table or view.
Parameters
Table or view name to inspect. Can be a simple name (e.g., “customers”) or a fully qualified name (e.g., “analytics.main.customers”).
Database name containing the table. If not specified, defaults to the current database obtained via
current_database().Schema name containing the table. If not specified, defaults to the current schema obtained via
current_schema() (typically “main”).Response
Indicates whether the operation completed successfully.
The database that was queried.
The schema that was queried.
The table or view name that was inspected.
Either “table” or “view”.
Array of column objects. Each object contains:
name(string): Column nametype(string): DuckDB data type (e.g., “VARCHAR”, “BIGINT”, “TIMESTAMP”, “DOUBLE”)nullable(boolean): Whether the column accepts NULL valuescomment(string | null): User-defined comment, or null if not set
Total number of columns in the table or view.
Error message when success is false.
Type of error that occurred.
Examples
Simple Table in Current Database
Request:Table in Specific Database
Request:View with Specific Schema
Request:Table with Complex Types
Request:Error - Table Not Found
Request:Fully Qualified Table Names
You can specify the table using fully qualified names instead of separate parameters:
database.schema.table- Full qualificationdatabase.table- Uses default schematable- Uses current database and schema
database and schema parameters provide more explicit control.Default Behavior
Current Database: When no
database parameter is provided, uses current_database() (typically “main” for local files).Current Schema: When no
schema parameter is provided, uses current_schema() (typically “main”).Common Column Types
DuckDB supports many data types that may appear in column type fields:- Numeric:
BIGINT,INTEGER,SMALLINT,TINYINT,DOUBLE,FLOAT,DECIMAL(p,s) - String:
VARCHAR,TEXT - Date/Time:
DATE,TIMESTAMP,TIMESTAMP WITH TIME ZONE,TIME,INTERVAL - Boolean:
BOOLEAN - Binary:
BLOB - Structured:
JSON,STRUCT,LIST,MAP - Special:
UUID,ENUM
Tool Annotations
This tool is always read-only with
readOnlyHint: true and destructiveHint: false, regardless of server mode.Related Tools
- Use list_databases to discover available databases
- Use list_tables to find tables within a database
- Use execute_query to query data from the table