Skip to main content
Glama
truaxki
by truaxki

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
NameRequiredDescriptionDefault
table_nameYesName of the table to describe

Implementation Reference

  • 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"]
    }
  • 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"]
        }
    ),

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/truaxki/mcp-variance-log'

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