list_catalogs_tool
List all catalogs available for users.
⚠️ WORKFLOW: Call this after search_documentation_tool.
Start your catalog exploration here to discover available data sources.
📋 PREREQUISITES:
- Call search_documentation_tool first to understand what you're looking for
📋 NEXT STEPS after this tool:
1. Use list_databases_tool to explore databases in a catalog
2. Use list_tables_tool to find tables in a database
3. Use describe_table_tool to get table schemas
This tool retrieves all available catalogs accessible with the provided API key.
It is typically used as the first step in exploring the data hierarchy.
This tool will fetch both managed catalogs, as well as external catalogs. (e.g., on Databricks)
Parameters
----------
ctx : Context
FastMCP context (injected automatically)
Returns
-------
CatalogListOutput
A structured object containing catalog information.
- 'catalogs': List of catalog names.
- 'count': Number of catalogs found.
Example Usage for LLM:
- When user asks for available catalogs.
- Example User Queries and corresponding Tool Calls:
- User: "What catalogs are available?"
- Tool Call: list_catalogs()
- User: "Show me all the data sources"
- Tool Call: list_catalogs()
list_databases_tool
List all databases in a given catalog.
⚠️ WORKFLOW: Call this after list_catalogs_tool to explore a specific catalog.
📋 PREREQUISITES:
- Call search_documentation_tool first to understand what you're looking for
- Call list_catalogs_tool to discover available catalogs
📋 NEXT STEPS after this tool:
1. Use list_tables_tool to find tables in a database
2. Use describe_table_tool to get table schemas before writing queries
This tool retrieves all databases within a specified catalog.
Parameters
----------
catalog : str
The name of the catalog.
ctx : Context
FastMCP context (injected automatically)
Returns
-------
DatabaseListOutput
A structured object containing database information.
- 'catalog': The catalog name.
- 'databases': List of database names.
- 'count': Number of databases found.
Example Usage for LLM:
- When user asks for a specific catalog's databases.
- Example User Queries and corresponding Tool Calls:
- User: "List all databases in the 'wherobots' catalog."
- Tool Call: list_databases('wherobots')
- User: "What databases are in the foursquare catalog?"
- Tool Call: list_databases('foursquare')
list_tables_tool
List all tables in a given database.
⚠️ WORKFLOW: Call this after list_databases_tool to find tables in a database.
📋 PREREQUISITES:
- Call search_documentation_tool first
- Call list_catalogs_tool and list_databases_tool to navigate to the database
📋 NEXT STEPS after this tool:
1. Use describe_table_tool to get the schema of tables you want to query
2. Use generate_spatial_query_tool to create SQL using the schema
3. Use execute_query_tool to test the query
This tool retrieves all tables within a specified database in a catalog. It is used to explore
the final level of the data hierarchy before accessing table schemas.
Parameters
----------
catalog : str
The name of the catalog.
database : str
The name of the database.
ctx : Context
FastMCP context (injected automatically)
Returns
-------
TableListOutput
A structured object containing table information.
- 'catalog': The catalog name.
- 'database': The database name.
- 'tables': List of table names.
- 'count': Number of tables found.
Example Usage for LLM:
- When user asks for a specific database's tables.
- Example User Queries and corresponding Tool Calls:
- User: "List all tables in the 'default' database of the 'wherobots' catalog."
- Tool Call: list_tables('wherobots', 'default')
- User: "What tables are in the overture database?"
- Tool Call: list_tables('wherobots_open_data', 'overture')
list_hierarchy_tool
Get complete hierarchy of catalogs, databases, and tables.
⚠️ WORKFLOW: Use this for a quick overview of all managed catalogs.
For external catalogs, use list_catalogs_tool instead.
📋 PREREQUISITES:
- Call search_documentation_tool first to understand what data you need
📋 NEXT STEPS after this tool:
1. Use describe_table_tool to get schemas of tables you want to query
2. Use list_catalogs_tool to discover external catalogs not shown here
This tool provides a comprehensive view of all available assets in the Wherobots system,
including their hierarchical relationships. It can be used to retrieve
information about all catalogs, list all databases within those catalogs,
and enumerate all tables within each database.
***
IMPORTANT LIMITATION:
- This tool is being DEPRECATED, but is the only way to get a full hierarchy in one call.
- This tool ONLY shows catalogs managed within Wherobots.
- External catalogs (e.g., on Databricks, other cloud platforms) are NOT visible in this hierarchy.
- If the user mentions specific catalog names that don't appear in the results, they may be
external catalogs that need to be accessed differently.
- ALWAYS call list_catalogs_tool before or after calling this tool.
***
Parameters
----------
ctx : Context
FastMCP context (injected automatically)
Returns
-------
HierarchyListOutput
A structured object containing the hierarchy of catalogs, databases, and tables.
- 'hierarchy': A dictionary representing the hierarchical structure, where keys are catalog names.
Each catalog entry contains a dictionary of its databases.
Each database entry includes a list of its tables.
Each table entry contains its name.
- 'summary': A dictionary providing counts of total catalogs, databases, and tables.
Example Usage for LLM:
- When user asks for a general overview of data, or specific items across multiple catalogs/databases.
- Example User Queries and corresponding Tool Calls:
- User: "List all tables in the 'default' database of the 'wherobots' catalog AND in the 'overture_maps_foundation' database of 'wherobots_open_data'."
- Tool Call: list_hierarchy()
- User: "Show me all databases in 'wherobots' and 'wherobots_open_data' catalogs."
- Tool Call: list_hierarchy()
- User: "What data is available?"
- Tool Call: list_hierarchy()
describe_table_tool
Describe a specific table.
⚠️ WORKFLOW: ALWAYS call this before writing queries that reference a table.
Understanding the schema is essential for writing correct SQL queries.
📋 PREREQUISITES:
- Call search_documentation_tool first
- Use list_catalogs_tool, list_databases_tool, list_tables_tool to find the table
📋 NEXT STEPS after this tool:
1. Use generate_spatial_query_tool to create SQL using the schema
2. Use execute_query_tool to test the query
This tool retrieves the schema of a specified table, including column names and types.
It is used to understand the structure of a table before querying or analysis.
Parameters
----------
catalog : str
The name of the catalog.
database : str
The name of the database.
table : str
The name of the table.
ctx : Context
FastMCP context (injected automatically)
Returns
-------
TableDescriptionOutput
A structured object containing the table schema information.
- 'schema': The schema of the table, which may include column names, types, and other metadata.
Example Usage for LLM:
- When user asks for the schema of a specific table.
- Example User Queries and corresponding Tool Calls:
- User: "What is the schema of the 'users' table in the 'default' database of the 'wherobots' catalog?"
- Tool Call: describe_table('wherobots', 'default', 'users')
- User: "Describe the buildings table structure"
- Tool Call: describe_table('wherobots_open_data', 'overture', 'buildings')
generate_spatial_query_tool
Generate a spatial query based on the provided content.
⚠️ WORKFLOW: Call this ONLY after exploring docs and catalog.
For best results, ensure you have already:
1. Called search_documentation_tool for relevant spatial functions
2. Used catalog tools to identify available tables
3. Called describe_table_tool for tables you want to query
📋 PREREQUISITES (strongly recommended):
- search_documentation_tool: Understand available spatial functions
- list_catalogs_tool / list_tables_tool: Find relevant tables
- describe_table_tool: Know the schema of tables you'll query
📋 NEXT STEPS after this tool:
1. Use execute_query_tool with limit=10 to TEST the query first
2. Iterate on the query if results are incorrect
3. Only generate application code AFTER SQL is validated
This tool allows user to translate their request into a spatial query.
Parameters
----------
user_prompt : str
The user's request or description of the spatial query they want to generate.
ctx : Context
FastMCP context (injected automatically)
Returns
-------
QueryGenerationSummaryOutput
A structured object containing the generated spatial query.
Example Usage for LLM:
- When user asks to generate a spatial query based on their request.
- When a user asks for information, statistics or analysis on data that is in tables
within one or more of the catalogs they have access to in Wherobots.
- Example User Queries and corresponding Tool Calls:
- User: "Generate a SQL query to count buildings in California using Overture data."
- Tool Call: generate_spatial_query("Generate a SQL query to count buildings in California using Overture data.")
- User: "How can I find all parks within 5km of downtown Seattle?"
- Tool Call: generate_spatial_query("How can I find all parks within 5km of downtown Seattle?")