list_databases
Retrieve all database names from StarRocks for schema discovery and data analysis, enabling users to explore available data sources.
Instructions
List all databases in StarRocks
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": "list_databases"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/starrocks_mcp/client.py:84-87 (handler)The actual implementation of the list_databases logic, executing a SQL query on the StarRocks instance.
def list_databases(self) -> List[str]: """List all databases.""" results = self.execute_query("SHOW DATABASES") return [row["Database"] for row in results] - The MCP tool handler in table_tools.py that calls client.list_databases().
if name == "list_databases": databases = client.list_databases() return [ TextContent( type="text", text=f"Found {len(databases)} databases:\n\n{format_json(databases)}", ) ] - src/starrocks_mcp/tools/table_tools.py:29-33 (registration)Registration of the "list_databases" tool definition.
Tool( name="list_databases", description="List all databases in StarRocks", inputSchema={"type": "object", "properties": {}}, ),