Skip to main content
Glama
kdqed
by kdqed

describe_table

Analyze table structure by listing columns and data types from specified data sources to understand database schema for SQL queries and data visualization.

Instructions

Lists columns and their types in the specified table of specified data source.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_idYesThe data source
table_nameYesThe table in the data source

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Primary MCP tool handler for 'describe_table'. Accepts source_id and table_name, retrieves data source from self.data_sources, calls the helper query_utils.describe_table, formats as markdown table, with error handling.
    def describe_table(self, 
        source_id: Annotated[
            str, Field(description='The data source')
        ], 
        table_name: Annotated[
            str, Field(description='The table in the data source')
        ]
    ) -> str:
        """
        Lists columns and their types in the specified table of specified data source.
        """
        
        try:
            source = self.data_sources.get(source_id)
            if not source:
                return f"Source {source_id} Not Found"
    
            result = query_utils.describe_table(source, table_name)
            return result.to_markdown(index=False)
        
        except Exception as e:
            return str(e)
  • Input schema via Pydantic Annotated and Field for source_id (str: The data source) and table_name (str: The table in the data source), with docstring describing purpose.
    def describe_table(self, 
        source_id: Annotated[
            str, Field(description='The data source')
        ], 
        table_name: Annotated[
            str, Field(description='The table in the data source')
        ]
    ) -> str:
        """
        Lists columns and their types in the specified table of specified data source.
        """
  • MCP server registration: Instantiates ZaturnTools with sources, creates FastMCP, and registers all tools (including describe_table) using Tool.from_function.
    zaturn_tools = ZaturnTools(sources)
    zaturn_mcp = FastMCP()
    for tool_function in zaturn_tools.tools:
        zaturn_mcp.add_tool(Tool.from_function(tool_function))
    
    return zaturn_mcp
  • Core helper logic: Dispatches to appropriate SQL DESCRIBE/PRAGMA/INFORMATION_SCHEMA query based on source['source_type'], invoking execute_query.
    def describe_table(source, table_name):
        match source['source_type']:
            case 'sqlite':
                return execute_query(source,
                    f'PRAGMA table_info("{table_name}");'
                )
                
            case 'postgresql' | 'mssql' | 'bigquery':
                return execute_query(source,
                    f"SELECT column_name, data_type, is_nullable FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '{table_name}';"
                )
                
            case "mysql" | "duckdb" | "csv" | "parquet" | "clickhouse":
                if ' ' in table_name:
                    table_name = f'`{table_name}`'
                    
                return execute_query(source,
                    f'DESCRIBE {table_name};'
                )
  • Initial registration of describe_table in Core class's self.tools list, which is then propagated to ZaturnTools and MCP.
    self.tools = [
        self.list_data_sources,
        self.describe_table,
        self.run_query,
    ]
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. It states it 'Lists columns and their types', implying a read-only operation, but doesn't disclose behavioral traits like whether it requires specific permissions, how it handles errors, or if it has rate limits. This is a significant gap for a tool with no annotation coverage.

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 wasted words. It is appropriately sized and front-loaded, making it easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that there is an output schema (which handles return values), the description's minimal coverage of purpose is somewhat acceptable. However, with no annotations and incomplete behavioral transparency, it leaves gaps in understanding the tool's full context and usage.

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?

Schema description coverage is 100%, so the schema already documents both parameters ('source_id' and 'table_name') adequately. The description adds no additional meaning beyond what the schema provides, such as format examples or constraints, resulting in the baseline score.

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 ('Lists') and resource ('columns and their types in the specified table of specified data source'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'list_data_sources' or 'run_query', 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. It doesn't mention prerequisites, context, or exclusions, leaving the agent to infer usage from the purpose alone.

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/kdqed/zaturn'

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