Skip to main content
Glama
tushar3006

Snowflake MCP Server

by tushar3006

list_schemas

Retrieve all schema names from a specified Snowflake database to explore database structure and organize data objects.

Instructions

List all schemas in a database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseYesDatabase name to list schemas from

Implementation Reference

  • Core handler function that executes the logic to list schemas from a specified Snowflake database. It runs a SQL query, applies exclusion filters if configured, formats results as YAML and JSON, and returns them as TextContent and EmbeddedResource.
    async def handle_list_schemas(arguments, db, *_, exclusion_config=None):
        if not arguments or "database" not in arguments:
            raise ValueError("Missing required 'database' parameter")
    
        database = arguments["database"]
        query = f"SELECT SCHEMA_NAME FROM {database.upper()}.INFORMATION_SCHEMA.SCHEMATA"
        data, data_id = await db.execute_query(query)
    
        # Filter out excluded schemas
        if exclusion_config and "schemas" in exclusion_config and exclusion_config["schemas"]:
            filtered_data = []
            for item in data:
                schema_name = item.get("SCHEMA_NAME", "")
                exclude = False
                for pattern in exclusion_config["schemas"]:
                    if pattern.lower() in schema_name.lower():
                        exclude = True
                        break
                if not exclude:
                    filtered_data.append(item)
            data = filtered_data
    
        output = {
            "type": "data",
            "data_id": data_id,
            "database": database,
            "data": data,
        }
        yaml_output = data_to_yaml(output)
        json_output = json.dumps(output)
        return [
            types.TextContent(type="text", text=yaml_output),
            types.EmbeddedResource(
                type="resource",
                resource=types.TextResourceContents(uri=f"data://{data_id}", text=json_output, mimeType="application/json"),
            ),
        ]
  • Input schema validation for the tool, requiring a single 'database' string parameter.
    input_schema={
        "type": "object",
        "properties": {
            "database": {
                "type": "string",
                "description": "Database name to list schemas from",
            },
        },
        "required": ["database"],
    },
  • Registers the 'list_schemas' tool in the all_tools list, which is used by handle_list_tools() to expose the tool to MCP clients and by handle_call_tool() to dispatch calls to the handler.
    Tool(
        name="list_schemas",
        description="List all schemas in a database",
        input_schema={
            "type": "object",
            "properties": {
                "database": {
                    "type": "string",
                    "description": "Database name to list schemas from",
                },
            },
            "required": ["database"],
        },
        handler=handle_list_schemas,
    ),
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action but does not reveal any behavioral traits such as read-only status, potential side effects, error handling, or output format. This leaves significant gaps for an agent to understand how the tool behaves.

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 purpose without any unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly.

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?

Given the lack of annotations and output schema, the description is incomplete for a tool that lists data. It does not explain what the output contains (e.g., schema names, metadata) or any behavioral aspects like pagination or errors, leaving the agent with insufficient context for effective use.

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

Parameters3/5

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

The input schema has 100% description coverage, clearly documenting the single required parameter 'database'. The description adds no additional semantic meaning beyond what the schema provides, such as parameter constraints or examples, so it meets the baseline for high schema coverage.

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 ('all schemas in a database'), making the purpose unambiguous. However, it does not differentiate from sibling tools like 'list_databases' or 'list_tables' beyond the resource name, which prevents a perfect score.

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 such as 'list_databases' or 'list_tables'. It lacks context about prerequisites, exclusions, or typical use cases, offering only a basic statement of function.

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

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/tushar3006/MCP'

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