Skip to main content
Glama

list_databases

Retrieve all available databases for user access to enable data exploration and management operations.

Instructions

List all databases available to the user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'list_databases' MCP tool. It retrieves the list of available Snowflake databases using the SnowflakeClient and returns them as a list of strings.
    @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 []
  • src/main.py:105-105 (registration)
    The @mcp.tool() decorator registers the list_databases function as an MCP tool.
    @mcp.tool()
  • Helper method in SnowflakeClient class that executes the 'SHOW DATABASES' SQL command to list databases the user has access to.
    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