Skip to main content
Glama

list_warehouses

Retrieve a list of all warehouses accessible to the user within the DataPilot MCP Server, enabling efficient management and allocation of Snowflake database resources.

Instructions

List all warehouses available to the user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main MCP tool handler function for 'list_warehouses'. It uses the SnowflakeClient to fetch the list of available warehouses and provides user feedback via the context.
    @mcp.tool() async def list_warehouses(ctx: Context) -> List[Dict[str, Any]]: """List all warehouses available to the user""" await ctx.info("Retrieving list of warehouses...") try: client = await get_snowflake_client() warehouses = await client.list_warehouses() await ctx.info(f"Found {len(warehouses)} warehouses") return warehouses except Exception as e: logger.error(f"Error listing warehouses: {str(e)}") await ctx.error(f"Failed to list warehouses: {str(e)}") return []
  • src/main.py:237-237 (registration)
    The @mcp.tool() decorator registers the list_warehouses function as an MCP tool.
    @mcp.tool()
  • Helper method in SnowflakeClient that executes 'SHOW WAREHOUSES' SQL command to retrieve warehouse list.
    async def list_warehouses(self) -> List[Dict[str, Any]]: """List all warehouses user has access to""" result = await self.execute_query("SHOW WAREHOUSES") return result.data if result.success else []

Other Tools

Related Tools

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