Skip to main content
Glama

list_databases

Retrieve a comprehensive list of all accessible databases within the DataPilot MCP Server environment to manage and interact with Snowflake data resources effectively.

Instructions

List all databases available to the user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'list_databases' decorated with @mcp.tool(), which registers the tool and executes the logic by delegating to SnowflakeClient.list_databases()
    @mcp.tool() async def list_databases(ctx: Context) -> List[str]: """List all databases available to the user""" await ctx.info("Retrieving list of databases...") try: client = await get_snowflake_client() databases = await client.list_databases() await ctx.info(f"Found {len(databases)} databases") return databases except Exception as e: logger.error(f"Error listing databases: {str(e)}") await ctx.error(f"Failed to list databases: {str(e)}") return []
  • Core helper method in SnowflakeClient that implements the database listing logic by executing 'SHOW DATABASES' query and extracting names from results
    async def list_databases(self) -> List[str]: """List all databases user has access to""" result = await self.execute_query("SHOW DATABASES") return [row.get('name', '') for row in result.data if result.success]

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rickyb30/datapilot-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server