describe_table
Display the structure of a database table to understand its columns, data types, and schema details for data analysis or troubleshooting.
Instructions
Show structure of a specific table
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table_name | Yes | Name of the table to describe |
Implementation Reference
- src/mcp_variance_log/server.py:257-266 (handler)Handler implementation for the 'describe_table' tool. It extracts the table_name from arguments, queries sqlite_master for the table's CREATE SQL statement, and returns the result as text content.elif name == "describe_table": if not arguments or "table_name" not in arguments: raise ValueError("Missing table_name argument") table_name = arguments["table_name"] # Get table creation SQL instead of using PRAGMA results = db._execute_query( f"SELECT sql FROM sqlite_master WHERE type='table' AND name=?", (table_name,) ) return [types.TextContent(type="text", text=str(results))]
- JSON schema defining the input for 'describe_table' tool: requires a 'table_name' string parameter.inputSchema={ "type": "object", "properties": { "table_name": { "type": "string", "description": "Name of the table to describe" } }, "required": ["table_name"] }
- src/mcp_variance_log/server.py:217-230 (registration)Registration of the 'describe_table' tool in the @server.list_tools() handler, specifying name, description, and input schema.types.Tool( name="describe_table", description="Show structure of a specific table", inputSchema={ "type": "object", "properties": { "table_name": { "type": "string", "description": "Name of the table to describe" } }, "required": ["table_name"] } ),