Skip to main content
Glama
YannBrrd

Simple Snowflake MCP

by YannBrrd

list-snowflake-warehouses

Retrieve a list of available Snowflake Data Warehouses to manage resources efficiently using the Simple Snowflake MCP Server.

Instructions

List available Data Warehouses (DWH) on Snowflake.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that implements the core logic for the 'list-snowflake-warehouses' tool. It executes the 'SHOW WAREHOUSES' SQL command using the _safe_snowflake_execute helper and formats the output as detailed JSON or a simple list of names based on the 'include_details' parameter.
    elif name == "list-snowflake-warehouses":
        include_details = args.get("include_details", True)
        query = "SHOW WAREHOUSES"
        result = _safe_snowflake_execute(query, "List warehouses")
        if result["success"]:
            if include_details:
                output = json.dumps(result["data"], indent=2, default=str)
            else:
                warehouses = [row.get("name", "") for row in result["data"]]
                output = "\n".join(warehouses)
            return [types.TextContent(type="text", text=output)]
        else:
            return [types.TextContent(type="text", text=f"Snowflake error: {result['error']}")]
  • The tool registration in the handle_list_tools() function, including the tool's description and input schema definition for JSON Schema validation.
    types.Tool(
        name="list-snowflake-warehouses",
        description="List available Data Warehouses (DWH) on Snowflake with detailed information",
        inputSchema={
            "type": "object",
            "properties": {
                "include_details": {
                    "type": "boolean",
                    "default": True,
                    "description": "Include detailed warehouse information"
                }
            },
            "additionalProperties": False
        },
    ),
  • The input schema definition for the 'list-snowflake-warehouses' tool, specifying the optional 'include_details' boolean parameter.
        inputSchema={
            "type": "object",
            "properties": {
                "include_details": {
                    "type": "boolean",
                    "default": True,
                    "description": "Include detailed warehouse information"
                }
            },
            "additionalProperties": False
        },
    ),
  • Supporting helper function used by the tool handler to safely connect to Snowflake, execute the query, fetch results as JSON-compatible dicts, and handle errors.
    def _safe_snowflake_execute(query: str, description: str = "Query") -> Dict[str, Any]:
        """
        Safely execute a Snowflake query with proper error handling and logging.
        """
        try:
            logger.info(f"Executing {description}: {query[:100]}...")
            ctx = snowflake.connector.connect(**SNOWFLAKE_CONFIG)
            cur = ctx.cursor()
            cur.execute(query)
            
            # Handle different query types
            if cur.description:
                rows = cur.fetchall()
                columns = [desc[0] for desc in cur.description]
                result = [dict(zip(columns, row)) for row in rows]
            else:
                result = {"status": "success", "rowcount": cur.rowcount}
                
            cur.close()
            ctx.close()
            logger.info(f"{description} completed successfully")
            return {"success": True, "data": result}
            
        except Exception as e:
            logger.error(f"{description} failed: {str(e)}")
            return {"success": False, "error": str(e), "data": None}
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'available' warehouses but doesn't clarify what 'available' means (e.g., accessible to current user, currently running), nor does it describe output format, pagination, permissions required, or error conditions. This leaves significant gaps for a tool that presumably returns a list.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without any fluff or redundant information. It's appropriately sized for a zero-parameter list operation and front-loads the core purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a list operation with no annotations and no output schema, the description is insufficient. It doesn't explain what information is returned about warehouses (e.g., names, statuses, sizes), how results are structured, or any limitations (e.g., max results). The lack of behavioral context makes it incomplete for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters with 100% schema description coverage, so the schema already fully documents the input structure. The description appropriately doesn't add parameter information since none exist, maintaining focus on the tool's purpose without unnecessary detail.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('available Data Warehouses (DWH) on Snowflake'), making the purpose unambiguous. It doesn't explicitly differentiate from sibling tools like 'list-databases' or 'list-views', but the resource specificity provides implicit distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'list-databases' or 'list-views', nor does it mention any prerequisites or context for usage. It simply states what the tool does without addressing when it's appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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/YannBrrd/simple_snowflake_mcp'

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