Skip to main content
Glama
tushar3006

Snowflake MCP Server

by tushar3006

describe_table

Retrieve schema information for a specific Snowflake table, including column details and data types, to understand table structure and support database operations.

Instructions

Get the schema information for a specific table

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_nameYesFully qualified table name in the format 'database.schema.table'

Implementation Reference

  • The main handler function that parses the fully qualified table name, executes a query against INFORMATION_SCHEMA.COLUMNS to retrieve column metadata (name, default, nullable, data_type, comment), formats the output as YAML text and JSON embedded resource.
    async def handle_describe_table(arguments, db, *_):
        if not arguments or "table_name" not in arguments:
            raise ValueError("Missing table_name argument")
    
        table_spec = arguments["table_name"]
        split_identifier = table_spec.split(".")
    
        # Parse the fully qualified table name
        if len(split_identifier) < 3:
            raise ValueError("Table name must be fully qualified as 'database.schema.table'")
    
        database_name = split_identifier[0].upper()
        schema_name = split_identifier[1].upper()
        table_name = split_identifier[2].upper()
    
        query = f"""
            SELECT column_name, column_default, is_nullable, data_type, comment 
            FROM {database_name}.information_schema.columns 
            WHERE table_schema = '{schema_name}' AND table_name = '{table_name}'
        """
        data, data_id = await db.execute_query(query)
    
        output = {
            "type": "data",
            "data_id": data_id,
            "database": database_name,
            "schema": schema_name,
            "table": table_name,
            "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"),
            ),
        ]
  • Registers the describe_table tool in the all_tools list, specifying name, description, input schema (requiring fully qualified table_name), and linking to the handle_describe_table handler. This tool object is then filtered and exposed via list_tools and call_tool.
    Tool(
        name="describe_table",
        description="Get the schema information for a specific table",
        input_schema={
            "type": "object",
            "properties": {
                "table_name": {
                    "type": "string",
                    "description": "Fully qualified table name in the format 'database.schema.table'",
                },
            },
            "required": ["table_name"],
        },
        handler=handle_describe_table,
    ),
  • Defines the input schema for the describe_table tool: an object with a required 'table_name' string property expecting 'database.schema.table' format.
    input_schema={
        "type": "object",
        "properties": {
            "table_name": {
                "type": "string",
                "description": "Fully qualified table name in the format 'database.schema.table'",
            },
        },
        "required": ["table_name"],
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't cover important aspects like whether it's a read-only operation, potential error conditions (e.g., if the table doesn't exist), or the format of the returned schema information. This leaves gaps in understanding how the tool behaves in practice.

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, clear sentence that efficiently conveys the core purpose without any wasted words. It's front-loaded with the essential information, making it easy to parse and understand 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 retrieves schema information. It doesn't explain what the output looks like (e.g., column names, data types, constraints) or handle edge cases, which is crucial for an AI agent to use this tool effectively in a database context.

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 schema description coverage is 100%, with the parameter 'table_name' fully documented in the input schema as a required string in 'database.schema.table' format. The description doesn't add any additional parameter semantics beyond what the schema provides, so it meets the baseline for high schema coverage without compensating with extra details.

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 ('Get') and resource ('schema information for a specific table'), making the purpose immediately understandable. However, it doesn't distinguish this tool from potential sibling tools like 'list_tables' or 'read_query', which might also provide table-related information.

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_tables' (which might list tables without schema details) or 'read_query' (which might execute queries). There's no mention of prerequisites, such as needing to know the table name beforehand from other tools.

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