Skip to main content
Glama
jesse-smith
by jesse-smith

get_column_info

Compute per-column statistical profiles for a table, including row counts, distinct counts, null percentages, and type-specific stats, to assess data quality and distribution.

Instructions

Retrieve per-column statistical profiles for a table.

EXPERIMENTAL — Statistics are based on common practices but have not been battle-tested for utility. Use as a starting point for investigation, not as definitive answers.

Computes row counts, distinct counts, null counts/percentages, and type-specific statistics for each column. Numeric columns get min/max/mean/stddev. Datetime columns get min/max dates, range in days, and whether a time component is present. String columns get min/max/avg length and a sample of top frequent values.

Args: connection_id: Connection ID from connect_database table_name: Name of the table. May be dotted (e.g. 'schema.table' or 'catalog.schema.table') and is resolved against the dialect. schema_name: Schema name. Defaults to the dialect's default schema (e.g. 'dbo' on MSSQL) when omitted. columns: Explicit list of column names to analyze (takes precedence over pattern) column_pattern: SQL LIKE pattern to filter column names (e.g., '%_id') sample_size: Number of top frequent value samples for string columns (default: 10) catalog: Optional Databricks catalog name. Rejected on non-Databricks dialects (returns an error response). On Databricks the catalog is threaded end-to-end: the existence check and column statistics are computed against the requested catalog (cross-catalog supported via catalog-scoped reflection — IDENT-08).

Returns: TOON-encoded string with status, table/schema metadata, and column statistics:

    status: "success" | "error"
    table_name: string                 // on success only
    schema_name: string                // on success only
    total_columns_analyzed: int        // on success only
    columns: list                      // on success only
        column_name: string
        data_type: string
        total_rows: int
        distinct_count: int
        distinct_count_approximate: bool   // true = HLL-approximate (Databricks fast path)
        null_count: int
        null_percentage: float
        numeric_stats: object          // numeric columns only
            min_value: float | null
            max_value: float | null
            mean_value: float | null
            std_dev: float | null
        datetime_stats: object         // datetime columns only
            min_date: ISO 8601 string | null
            max_date: ISO 8601 string | null
            date_range_days: int | null
            has_time_component: bool
        string_stats: object           // string columns only
            min_length: int | null
            max_length: int | null
            avg_length: float | null
            sample_values: list of [string, int] pairs
    error_message: string              // on error only

Error conditions: - Invalid connection_id: returns status "error" with error_message - Table not found: returns status "error" with error_message - Column not found (explicit list): returns status "error" with error_message - No columns match pattern: returns status "success" with empty columns list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
catalogNo
columnsNo
table_nameYes
sample_sizeNo
schema_nameNo
connection_idYes
column_patternNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals experimental status, approximate counts (HLL on Databricks fast path), type-specific behavior, error conditions, and dialect-specific catalog handling (rejected on non-Databricks). This is exceptionally transparent and goes far beyond a minimal 'get stats' statement.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but well-structured with clear sections (Description, Args, Returns, Error conditions). It front-loads the core purpose and then provides necessary details. No sentence is redundant, but the length is higher than minimal; however, given the parameter count and return format complexity, it earns its length. It is appropriately structured and readable.

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

Completeness5/5

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

For a 7-parameter tool with no annotations and no formal output schema, the description is remarkably complete. It documents all parameters, return structure with field types and notes, error conditions, and even edge cases like empty column lists. An agent has everything needed to invoke it correctly and interpret results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does thoroughly. Every parameter (connection_id, table_name, schema_name, columns, column_pattern, sample_size, catalog) is explained with defaults, precedence (columns over pattern), dotted-name resolution, and catalog behavior. This adds substantial meaning beyond the raw schema fields.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Retrieve per-column statistical profiles for a table.' This clearly distinguishes it from sibling tools like get_table_schema (schema only) and get_sample_data (sample rows). The term 'statistical profiles' is unambiguous, and the experimental caveat adds honest context without obscuring purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description states 'Use as a starting point for investigation, not as definitive answers,' which gives context on when to apply results. However, it does not explicitly contrast this tool with siblings like get_table_schema or get_sample_data. The differentiation is implied by the description but not stated outright, leaving the agent to infer when this is the right choice over alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.