show_catalogs
Retrieve a list of all available catalogs in Trino to identify data sources for querying.
Instructions
List all available catalogs
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "show_catalogs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/server.py:35-38 (handler)The MCP tool handler for 'show_catalogs'. Decorated with @mcp.tool, it delegates to client.list_catalogs().
@mcp.tool(description="List all available catalogs") def show_catalogs() -> str: """List all available catalogs.""" return client.list_catalogs() - src/trino_client.py:100-107 (helper)The TrinoClient.list_catalogs() method that executes 'SHOW CATALOGS' query and returns newline-separated catalog names.
def list_catalogs(self) -> str: """List all available catalogs. Returns: str: Newline-separated list of catalog names. """ catalogs = [row["Catalog"] for row in json.loads(self.execute_query("SHOW CATALOGS"))] return "\n".join(catalogs) - src/server.py:35-35 (registration)The tool is registered via the @mcp.tool decorator on the show_catalogs function, with description 'List all available catalogs'.
@mcp.tool(description="List all available catalogs")