Skip to main content
Glama
jgravelle
by jgravelle

find_unused_columns

Read-only

Identify database columns with zero or stale query traffic using runtime logs, excluding primary keys and audit fields, to find unused columns for cleanup.

Instructions

Surface columns with zero or stale runtime traffic. Reads runtime_query_calls (populated by ingest_sql_log) and surfaces columns that haven't been queried within window_days. Excludes primary-key candidates and audit fields (created_at / updated_at / dbt_*) by default. Refuses to run with explicit error when no runtime data has been ingested — would otherwise trivially flag every column.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
min_callsNoFloor for 'considered used' within window. Default 0.
dataset_idYes
exclude_pkNoSkip primary-key candidates. Default true.
window_daysNoLook-back window. Default 30.
exclude_auditNoSkip audit columns (created_at, updated_at, dbt_*, etc). Default true.
Behavior5/5

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

The description goes well beyond the readOnlyHint annotation by disclosing that it reads from runtime_query_calls, excludes primary-key candidates and audit fields by default, and refuses to run when no runtime data exists. It also explains the rationale for the refusal ('would otherwise trivially flag every column'), giving the agent insight into the tool's failure mode.

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 four sentences, each with a distinct purpose: statement of function, data source, exclusions, and error behavior. It is front-loaded with the core purpose and contains no redundant wording.

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

Completeness4/5

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

The description covers the tool's purpose, data dependency, exclusions, and error condition, which is sufficient for a read-only list tool. The only minor gap is it does not explicitly describe the return format (e.g., a list of column names), but given the tool's name and purpose, this is reasonably inferable.

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

Parameters4/5

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

The description adds meaning to window_days by defining it as the look-back window for what counts as 'queried', and clarifies the default exclusion behavior for primary keys and audit fields, which maps to exclude_pk and exclude_audit. Since the schema already documents 4 of 5 parameters, this contextual explanation provides additional value beyond the schema descriptions.

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 that the tool surfaces columns with zero or stale runtime traffic, specifying the resource (columns) and the condition (not queried within window_days). It distinguishes from siblings like find_similar_columns and check_column_drop_safe by its reliance on runtime query logs, though it does not explicitly name alternatives.

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 implies when to use the tool: after runtime data has been ingested via ingest_sql_log, and for identifying under- or un-used columns. It also warns that it refuses to run without ingested data, a clear precondition, but it does not explicitly state when not to use it or name alternative tools.

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/jgravelle/jdatamunch-mcp'

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