search_tables
Find Databricks tables by name using information_schema queries to locate specific data assets across catalogs.
Instructions
Search tables by name (using information_schema)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | Yes | ||
| catalog | No |
Implementation Reference
- tools/query.py:70-85 (handler)Implementation of the search_tables tool, which queries the information_schema to find tables matching a keyword.
def search_tables(ctx: Context, keyword: str, catalog: str = None) -> List[Dict[str, Any]]: """Search tables by name (using information_schema)""" if not catalog: raise ToolError("Must specify catalog parameter") cat = safe_identifier(catalog, "catalog") safe_identifier(keyword, "keyword") # validate only, no quote needed for LIKE sql = f""" SELECT table_catalog, table_schema, table_name, table_type, comment FROM {cat}.information_schema.tables WHERE table_name LIKE '%{keyword}%' LIMIT 50 """ return execute_sql(ctx, sql)