We Built a Machine for Getting AnswersTry the MotherDuck MCP

Skip to main content

search_catalog

Search the catalog for databases, schemas, tables, columns, and shares using fuzzy matching.

Description

The search_catalog tool performs fuzzy search across your entire MotherDuck catalog. It finds matching objects by name using partial matching, supporting underscores, dots, and multi-word queries. This is useful for discovering available data when you don't know exact names.

The search uses Jaro-Winkler similarity scoring and returns results ranked by relevance. Results are limited per category to provide a balanced view across different object types.

Input Parameters

ParameterTypeRequiredDescription
querystringYesSearch term to find in object names (supports partial matching, underscores, dots)
object_typesstring[]NoFilter results to specific types: "database", "schema", "table", "column", "share"

Output Schema

{
"success": boolean,
"query": string, // Search query used
"resultCount": number, // Total results found
"results": [ // Search results (on success)
{
"type": "database" | "schema" | "table" | "column" | "share",
"name": string, // Object name
"fullyQualifiedName": string, // Full path (e.g., "db.schema.table.column")
"database": string | null, // Database (null for shares)
"schema": string | null, // Schema (null for databases/shares)
"table": string | null, // Table (only for columns)
"dataType": string | null, // Data type (columns) or URL (shares)
"comment": string | null, // Object comment if set
"relevanceScore": number // Match score 0-1 (higher is better)
}
],
"error": string, // Error message (on failure)
"errorType": string // Error type (on failure)
}

Result Limits

Results are limited per object type to provide balanced coverage:

  • Shares: 10 results
  • Columns: 40 results
  • Tables: 30 results
  • Schemas: 20 results
  • Databases: 20 results

Maximum total results: 100

Example Usage

Search for tables with "sales" in the name:

Find all tables related to sales data

The AI assistant will call the tool with:

{
"query": "sales"
}

Search only for columns:

Find columns containing "email"
{
"query": "email",
"object_types": ["column"]
}

Search with qualified name:

Find anything matching analytics.events
{
"query": "analytics.events"
}

Success Response Example

{
"success": true,
"query": "sales",
"resultCount": 8,
"results": [
{
"type": "table",
"name": "sales_data",
"fullyQualifiedName": "analytics.main.sales_data",
"database": "analytics",
"schema": "main",
"table": null,
"dataType": null,
"comment": "Daily sales transactions",
"relevanceScore": 0.95
},
{
"type": "table",
"name": "monthly_sales",
"fullyQualifiedName": "analytics.main.monthly_sales",
"database": "analytics",
"schema": "main",
"table": null,
"dataType": null,
"comment": null,
"relevanceScore": 0.89
},
{
"type": "column",
"name": "total_sales",
"fullyQualifiedName": "analytics.main.revenue.total_sales",
"database": "analytics",
"schema": "main",
"table": "revenue",
"dataType": "DECIMAL(18,2)",
"comment": "Total sales amount",
"relevanceScore": 0.87
},
{
"type": "share",
"name": "regional_sales_share",
"fullyQualifiedName": "regional_sales_share",
"database": "regional_sales_share",
"schema": null,
"table": null,
"dataType": "md:_share/org123/regional_sales_share",
"comment": null,
"relevanceScore": 0.82
}
]
}

Error Response Example

{
"success": false,
"error": "Search query cannot be empty",
"errorType": "ValidationError"
}