list_tables
List tables and views in SQL Server schemas with row counts and metadata. Filter by schema, name pattern, or minimum rows; sort and paginate results for efficient schema exploration.
Instructions
List tables in specified schema(s) with row counts and metadata.
Efficiently retrieves table metadata using SQL Server DMVs. Supports filtering by schema, name pattern, and minimum row count. Supports pagination via offset parameter. Supports filtering by object type to include/exclude views.
Args: connection_id: Connection ID from connect_database schema_filter: List of schema names to include (empty = all schemas) name_pattern: Table name filter using SQL LIKE pattern (e.g., 'Customer%') min_row_count: Minimum row count threshold to filter tables sort_by: Sort criterion - 'name', 'row_count', or 'last_modified' (default: 'row_count') sort_order: Sort order - 'asc' or 'desc' (default: 'desc') limit: Maximum tables to return, 1-1000 (default: 100) offset: Number of results to skip for pagination (default: 0) object_type: Filter by type - 'table', 'view', or None for all (default: None) output_mode: 'summary' (names+row counts) or 'detailed' (includes columns) (default: 'summary') catalog: Optional Databricks catalog name. Overrides the connection's default catalog. Rejected on non-Databricks dialects (raises an error).
Returns: TOON-encoded string with table list and pagination metadata:
status: "success" | "error"
returned_count: int // on success only
total_count: int // on success only
offset: int // on success only
limit: int // on success only
has_more: bool // on success only
tables: list // on success only
schema_name: string
table_name: string
table_type: "table" | "view"
row_count: int
has_primary_key: bool
last_modified: ISO 8601 string | null
access_denied: bool
columns: list // detailed mode only
error_message: string // on error only
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No | ||
| catalog | No | ||
| sort_by | No | row_count | |
| sort_order | No | desc | |
| object_type | No | ||
| output_mode | No | summary | |
| name_pattern | No | ||
| connection_id | Yes | ||
| min_row_count | No | ||
| schema_filter | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |