Skip to main content
Glama

describe_table

Retrieve schema details for Snowflake tables to understand column structure, data types, and table organization for data analysis and integration.

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

  • Executes the describe_table tool: parses 'database.schema.table', queries INFORMATION_SCHEMA.COLUMNS for column details, formats as YAML (and optional JSON) output.
    async def handle_describe_table(arguments, db, *_, exclude_json_results=False): 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 = to_yaml(output) json_output = to_json(output) results: list[ResponseType] = [types.TextContent(type="text", text=yaml_output)] if not exclude_json_results: results.append( types.EmbeddedResource( type="resource", resource=types.TextResourceContents( uri=f"data://{data_id}", text=json_output, mimeType="application/json" ), ) ) return results
  • Registers the describe_table tool in the all_tools list with name, description, input schema, and handler reference.
    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 describe_table tool: requires 'table_name' as string in format 'database.schema.table'.
    input_schema={ "type": "object", "properties": { "table_name": { "type": "string", "description": "Fully qualified table name in the format 'database.schema.table'", }, }, "required": ["table_name"], },

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/isaacwasserman/mcp-snowflake-server'

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